Ruby link_button_to
A helper for a link_button_to.
Usage: <%= link_button_to "Edit", url_for(:action=>"edit"), :class=>"my_custom_class" -%>
def link_button_to(name, options = {}, html_options = {}) url = url_for(options) html_options["onclick"] = "javascript:document.location.href='#{url}'; return false;" html_options.merge!("type" => "button", "value" => name) tag("input", html_options) end
Usage: <%= link_button_to "Edit", url_for(:action=>"edit"), :class=>"my_custom_class" -%>