Hello I have a view for user registration but when i try to view this page i get this error: undefined method `stringify_keys'' for "username":String Here''s my registration.rhtml: <% form_tag :controller => :user, :action => :register do %> <fieldset> <label for="username">Username>/label><br/><%= text_field_tag ''user'', nil, ''username'' -%> <br/><br/> <label for="password">Password</label><br/><%= password_field_tag ''user'', nil, ''password'' -%> <br/><br/> <label for="email">E-mail</label><br/> <%= email_field_tag ''user'', nil, ''email'' -%> <br/><br/> </fieldset> <%= submit_tag ''Register'' -%> <% end %> What''s my problem and what does this error means? i''ve searched google but couldn''t find enough info. Thanks. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The error is coming from your "text_field_tag", "password_field_tag" and so on, http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M000605 you''ll see it goes text_field_tag(name, value = nil, options = {}) but you''re doing "user", nil "username" it expects the 3rd argument to be a hash, and it calls "stringify_keys" on the hash. I think you mean to be using http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M000496 textfield("user", "username") Bahadır Doğan wrote:> undefined method `stringify_keys'' for "username":String> <%= text_field_tag ''user'', nil, ''username'' -%> > <%= password_field_tag ''user'', nil, ''password'' -%> > <%= email_field_tag ''user'', nil, ''email'' -%>-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks, that solved the problem. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- stringify_keys!
- NewbieQ : undefined method `stringify_keys!'' Dumb Question
- HELP: NoMethodError (undefined method `stringify_keys!'' for
- Help with a select_tag; getting an undefined method `stringify_keys' error
- undefined method `stringify_keys!' for "4":String - Meaning of this?