Forum: Ruby on Rails Using select with saltedhashlogingenerator

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0296edeb2af8022220f4a14f27255a83?d=identicon&s=25 a non y mouse (Guest)
on 2006-02-07 11:40
(Received via mailing list)
hi, i just got started with rails and am trying to work with the  (deep
breath) saltedhashlogingenerator gem in my app.

more specifically, i am trying to generate a select box in my _edit
partial, via:

    <%= form_input select(:id, :name, @customers) %>

(i used Customer instead of User when installing the gem into my rails
app) this would appear to be the correct syntax, based on the wiki
documentation for using select. but i get an error:

You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.inject

@customers is created via:

  def list
    @customer_pages, @customers = paginate :customers, :per_page => 10
  end

which i believe is the default when creating the scaffold. i tried using
@customers.list in the _edit partial but got the same result.

i did notice that its list method uses paginate rather than find_all
which is what the onlamp articles for getting started with rails uses.
sooooo i tried using that, which was equally vain.

am i completely missing something here? :\

thanks!

ps- i also checked out how typo addresses this issue, because i believe
the author of typo is who wrote the module. but it appears that typo
uses no select methods at all--they are all done manually!
0296edeb2af8022220f4a14f27255a83?d=identicon&s=25 a non y mouse (Guest)
on 2006-02-07 12:45
(Received via mailing list)
a non y mouse wrote:
> hi, i just got started with rails and am trying to work with the  (deep
> breath) saltedhashlogingenerator gem in my app.
>
> more specifically, i am trying to generate a select box in my _edit
> partial, via:
>
>     <%= form_input select(:id, :name, @customers) %>
>

ok, so I just realized that :name should be :login (whoops), but
regardless i am still unable to get anything working with this :(
This topic is locked and can not be replied to.