Displaying 2 results from an estimated 2 matches for "increase_counter".
2012 May 15
1
How to handle ActiveRecord::RecordInvalid
...rd::RecordInvalid. Here
is the error page:
<http://i.stack.imgur.com/YDiNN.png>
And here is the category service:
def self.create(params)
ActiveRecord::Base.transaction do
begin
category = Category.new(params)
decrease_counters(category.id)
increase_counters(category.id)
category.save!
end
end
end
In finally here is the my controller:
controller do
def create
category = Service::CategoryService.create(params[:category])
if category
flash[:notice] = "Category was successfully created."...
2007 Sep 20
11
Proposed API change for respond_to
Ez (or someone) asked on #merb tonight whether respond_to was the
right API for
what it does. After some discussion and pasties, I offer the
following proposed
API for content negotiation and response format selection:
First, what does respond_to do right now? I see at as performing 3
distinct
operations:
1. parse params[:format] and the accepts header to find out what
format the