Forum: Ruby on Rails Rails API is not well defined

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.
Mario T. L. (Guest)
on 2007-05-22 23:48
Although somewhat new, I continue to struggle with passing the right
parameters to  the Rails methods despite making direct reference to the
documentation.  For example, I want to create a form:

form_tag :action => 'deliver', :id =>, :class => 'entry'

The class doesn't show up.  I've tried various combinations of hash
braces.  Also, what if I want to pass in an id for the form tag itself
(e.g. #myentryform).

This is a little frustrating.  Has anyone else experienced this?  What
got you past this hurdle?

Greg D. (Guest)
on 2007-05-22 23:58
(Received via mailing list)
On 5/22/07, Mario T. Lanza <removed_email_address@domain.invalid> wrote:
> This is a little frustrating.  Has anyone else experienced this?  What
> got you past this hurdle?

You have to establish when your first hash of parameters ends,
otherwise form_tag will assume your :action, :id, and :class options
are a single hash, when :class really needs to go in a separate hash.

This might help explain a bit more:

Greg D.
John L. (Guest)
on 2007-05-23 00:04
(Received via mailing list)

Consider this:

<%=start_form_tag({ :action=> 'quick_create', :upload_id => @upid },
:id => 'quick_campaign_form', :multipart => true})%>

You would put :class in the 2nd hash (eg. after :multipart).  Otherwise,
:class goes into the url_for method and I think is used as a param in
form post/get.
Mario T. L. (Guest)
on 2007-05-23 01:29
Thanks, guys.  After a few attempts I eventually did get it working,
it's just that often even with the help of the online RDoc it's not
clear.  I'm sure I'll get better. :)
tonypm (Guest)
on 2007-05-27 16:01
(Received via mailing list)

I had the same problem for a long time.  I would study the helper
methods, but just couldnt get my head around it all.  It seemed so
vague.  But the penny has just about dropped.  I think understanding
the Agile Rails chapters on form and field tags has helped.  But just
getting used to dealing with database results as models and feeling
comfortable with the terminology took time.  Now it starts to seem
obvious.  I guess the problem is that some of the Rails 'Automagic'
can initially tend to be 'Automysteryerious' .


On May 22, 10:29 pm, "Mario T. Lanza" <rails-mailing-l...@andreas-
This topic is locked and can not be replied to.