Created
January 26, 2012 23:03
-
-
Save coderforhire/1685692 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<td><%= button_to 'Close', ticket_path(ticket), :status => 'closed', :method =>"put", :class => "btn danger" %></td> | |
def set_status(status) | |
if status == 'closed' | |
self.status = 'closed' | |
else | |
self.status = 'open' | |
end | |
end | |
def update | |
@ticket = Ticket.find(params[:id]) | |
respond_to do |format| | |
if @ticket.update_attributes(params[:ticket]) | |
format.html { redirect_to tickets_open_path, notice: 'Ticket was successfully updated.' } | |
format.json { head :no_content } | |
else | |
format.html { render action: "edit" } | |
format.json { render json: @ticket.errors, status: :unprocessable_entity } | |
end | |
end | |
end |
def set_status(status)
self.status = status
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wrong number of arguments (0 for 1)
Rails.root: /home/afresta/rails_projects/Newground-Intranet
Application Trace | Framework Trace | Full Trace
app/models/ticket.rb:19:in
set_status' app/controllers/tickets_controller.rb:65:in
block in update'app/controllers/tickets_controller.rb:64:in `update'
Request
Parameters:
{"_method"=>"put",
"authenticity_token"=>"+tSED76jx53qwXHvJgY2MEepDBL+Da+EqQfEicoRpHg=",
"status"=>"closed",
"id"=>"8"}
Show session dump
Show env dump
Response
Headers:
None