ubique
ubique

Reputation: 1212

Change A Link To A Button?

I have this link - but I want to turn it into a button in rails 3?

<%= link_to 'New Article', new_article_path %>

Upvotes: 2

Views: 2903

Answers (1)

Matt Ball
Matt Ball

Reputation: 360016

Use a button-styled link.

<%= link_to 'New_Article', {:controller => "articles", :action => "new"}, {"data-icon" => "button", "data-theme" => "a"} %>

Or, as @Zabba points out, use the button_to helper.

<%= button_to 'New Article', {:controller => "articles", :action => "new"} %>

Upvotes: 3

Related Questions