Hi all, I''m relatively new to rails and have a question. I''ve looked through the archives, but really have no idea what to search for so I apologize if this has been addressed before. I am trying to use a form response for some logic in my controller. For example, if a check box is checked, redirect to another page. Obviously I don''t need this checkbox to have a place in the database. But rails thinks I do. How do I have a value in a form without having to have a place in the database for it and without getting a "method undefined" exception? Thanks Bryan -- 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 -~----------~----~----~----~------~----~------~--~---
Use check_box_tag instead of check_box Fred -- 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 -~----------~----~----~----~------~----~------~--~---
aust_guy wrote:> I''m relatively new to rails and have a question. I''ve looked through > the archives, but really have no idea what to search for so I apologize > if this has been addressed before. I am trying to use a form response > for some logic in my controller. For example, if a check box is > checked, redirect to another page. Obviously I don''t need this checkbox > to have a place in the database. But rails thinks I do. How do I have > a value in a form without having to have a place in the database for it > and without getting a "method undefined" exception?Rails thinks no such thing. Add your checkbox to your view, using <input type=''checkbox'' name=''foo'' />. Then in your controller, your value is in params[:foo]. No database required. If you are abusing the "scaffold" system, don''t. It''s just a one-shot thing; it''s not how most development should go. -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---