2

I'm having some troubles when I want to change the class of a form. I have this partial:

<%= simple_form_for(@activity) do |f| %>

    <%= f.input :name %>
    <%= f.submit 'Guardar',:class=>"btn success" %>

<% end %>

In the browser the form label has class="simple_form activity"

According to Simple Form documentation, I can change the class by doing this

<%= simple_form_for(@activity, :defaults=>{:class=>"my_class"}) do |f| %>

But nothing is happening, what is wrong?

JavierQ

1 Answer 1

3

I think you want to use:

:html => { :class => "btn success"}

Instead of:

:class=>"btn success"
Sign up to request clarification or add additional context in comments.

1 Comment

Well, actually the class of the button works :). The problem was with the form. I tried what you said and it works ..... but in my form. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.