Forum: Ruby on Rails form_for, attributes mapping for a Search model...

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Nicolas B. (Guest)
on 2008-10-06 17:56
Hi, here is my problem...

I use a custom form builders for my forms, so I have to use form_for
because form_tag does not work with form builders.

I have to implement a search engine, so I created a Search model (that
does not inherit from AR:B) with virtual accessors (q, category, etc).

Then I wrote a simple form with :

form_for @search, :builder => StandardBuilder, :method => :get do |f|

The problem is that Rails maps all the attributes in params[:search] and
the GET URL is not pretty at all :

Is there a way to create a form in Rails where the model attributes are
mapped in the root of the params hash ?

Or do you have another solution for this problem ?

This topic is locked and can not be replied to.