ruby on rails - Form_for hepler:reduce default html class -


i have little form_for @user, password reset, , don't want other @user edit forms. tried didn't assign form other default html class of form_for, "edit_user".

tried:

<%= form_for @user, :url=>update_pass_path(:class=>'reset_pass'), :method=>'put' |f| %>  

and:

 <%= form_for @user, :url=>update_pass_path, :class=>'reset_pass', :method=>'put' |f| %>  

still edit_user. solutions?

you can pass html options part of options hash

like this:

form_for(@user, :url=>update_pass_path, :html => { :class => "reset_pass", :method=>'put' }) |f|   ..... end 

see documentation: form - api docs


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -