use action prefix in form css class, closes #360 #377

Merged
merged 1 commit into from Dec 3, 2011

2 participants

@nashby

closes #360.

And there is one thing: in Rails, form_for :user doesn't generate any form class. But SimpleForm generate. Should I fix it too? /cc @josevalim

@rafaelfranca

It is fine for me generate this class.

@rafaelfranca rafaelfranca commented on an outdated diff Dec 3, 2011
lib/simple_form/action_view_extensions/form_helper.rb
@@ -42,13 +42,15 @@ def simple_form_for(record, options={}, &block)
end
def css_class(record, html_options)
+ action = record.respond_to?(:persisted?) && record.persisted? ? :edit : :new
@rafaelfranca
rafaelfranca added a line comment Dec 3, 2011

Could us move this line to inside of the else block?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@nashby

OK. Done!

@rafaelfranca

Thanks again mate

@rafaelfranca rafaelfranca merged commit 7c122cb into plataformatec:master Dec 3, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment