how to set class attribute with form_tag in rails

form_tag takes 2 options hashes, the first being passed to url_for, the second being passed to the form builder.

So, you have to do it like:

= form_tag({:action => 'create',...}, {:class => 'comment_form'}) do

otherwise Rails thinks all the key/value pairs are for url_for, which will append any keys it doesn’t understand as query parameters.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)