ruby on rails - updating database record with click event -



ruby on rails - updating database record with click event -

hi attempting remotely update element within database click event. when click event triggered getting next error, though believe i'm using right methods

started set "/availabilities/131/edit" 124.168.74.144 @ 2013-02-13 08:02:40 +0100 actioncontroller::routingerror (no route matches [put] "/availabilities/131/edit"):

haml click event

.six.columns#named_players %h5 named players %table.twelve %thead %tr %th alter status %th attending %tbody - @availabilities.each |a| %tr %td= full_name(a.user) %td %ul.button-group.two-up.even %li= button_to 'accept', edit_availability_path(a), :remote => true, :method => :put, :class => 'button tiny success', :disable_with => 'add' %li= link_to 'decline', '#', :remote => true, :method => :put, :class => 'button tiny alert'

controller

def update @availability = availability.find(params[:id]) respond_to |format| if @availability.update_attributes(params[:availability]) format.html { redirect_to @availability, :notice => 'availability updated.' } format.js else format.html { render :action => "edit" } format.js end end end

it seams clicking [put] "/availabilities/131/edit" instead of [put] "/availabilities/131/update"

ruby-on-rails jquery rails-activerecord ujs

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -