delvison
delvison

Reputation: 149

How would i make this into a button?

Hey so how can i turn this into a button in rails?

 <%= link_to "+Add Attachment!", :controller => "assets", :action => "new", :lesson_id => @lesson %>

Upvotes: 0

Views: 45

Answers (1)

Edd Morgan
Edd Morgan

Reputation: 2923

<%= button_to "+ Add Attachment", ... %>

Look into using the RESTful routing system, though, rather than specifying the :controller => "assets", :action => "new", ... hash.

You might consider using CSS to make the <a> from your <%= link_to ... %> look nice, rather than replacing it with an awkward button.

Upvotes: 1

Related Questions