Sean Six wrote:> I have a simple RESTful search scaffold that finds data in a separate
> model and controller.
>
> [code]
> <h1>New search</h1>
>
> <% form_for(@search) do |f| %>
> <%= f.error_messages %>
>
> <p>
> <%= f.label :category_id %><br />
> <%= f.collection_select :category_id, Category.all, :id, :name,
> :include_blank => true %>
> </p>
> <p>
> Age Range<br />
> <%= f.text_field :minimum_age, :size => 3 %> -
> <%= f.text_field :maximum_age, :size => 3 %>
> </p>
>
> <p>
> <%= f.submit ''Create'' %>
> </p>
> <% end %>
> [/code]
>
> I would like to require at least one parameter in the search, be it a
> selected category, a minimum age, or a maximum age.
Then write a custom validation method.
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.