30 Jul '12, 11am

@suginoy なるほどnameを中で使うのか

<%= button_to "New", :action => "new" %> # => "<form method="post" action="/controller/new" class="button_to"> # <div><input value="New" type="submit" /></div> # </form>" <%= button_to "New", :action => "new", :form_class => "new-thing" %> # => "<form method="post" action="/controller/new" class="new-thing"> # <div><input value="New" type="submit" /></div> # </form>" <%= button_to "Create", :action => "create", :remote => true, :form => { "data-type" => "json" } %> # => "<form method="post" action="/images/create" class="button_to" data-remote="true" data-type="json"> # <div><input value="Create" type="submit" /></div> # </form>" <%= button_to "Delete Image", { :action => "delete", :id => @image.id }, :confirm => "Are you sure?", :method => :delete %> # => "<form method="post" action="/images/delete/1" class="button_to"> # <div> # <input type="hidden" name="_method" value=...

Full article: http://api.rubyonrails.org/classes/ActionView/Helpers/Url...

Tweets