Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTessa Davis
4,152 PointsAdding Styling - using Simple Form and button_to
I'm trying to update the styling on the registrations/edit.html.erb page. I'm not sure how to use simple form for
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %></p>
This isn't right but I'm not sure how else to do it
<p>Unhappy? <%= f.button :submit, "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %></p>
Thanks
4 Answers
Jason Seifer
Treehouse Guest TeacherAfter the method key, try adding the following:
:class => 'btn'
That comes from the Twitter bootstrap documentation.
Jason Seifer
Treehouse Guest TeacherHi Tessa, what are you trying to accomplish exactly?
Tessa Davis
4,152 PointsI'm updating the look of the page using simple form to make it all look nicer, but I can't seem to work out how to make the 'Cancel my account' button into an f.button :submit like the others (see the code copied above - it doesn't work).
Tessa Davis
4,152 Pointsexcellent, problem solved. thanks