HAML:
= link_to 'redeem', redeem_admin_organization_path(organization), :class => 'button_short live redeem'
Controller:
def redeem
@organization = Organization.find(params[:id])
@organization.update_attribute('accumulated_credits', '0')
end
redeem.js.haml:
== $("#organization_#{@organization.id} .redeem").html("#{escape_javascript(link_to('redeem', redeem_admin_organization_path(@organization), :class => 'button_short live redeem'))}");
This is returning the error:
NoMethodError (undefined method `accumulated_credits=' for #<Organization:0x2f3242c>):