lib/inherited_resources/actions.rb in josevalim-inherited_resources-0.8.2 vs lib/inherited_resources/actions.rb in josevalim-inherited_resources-0.8.3

- old
+ new

@@ -27,11 +27,11 @@ respond_to(:with => resource, &block) end alias :edit! :edit # POST /resources - def create(redirect_url=nil, &block) + def create(&block) object = build_resource respond_block, redirect_block = select_block_by_arity(block) if object.save set_flash_message!(:notice, '{{resource_name}} was successfully created.') @@ -50,11 +50,11 @@ end end alias :create! :create # PUT /resources/1 - def update(redirect_url=nil, &block) + def update(&block) object = resource respond_block, redirect_block = select_block_by_arity(block) if object.update_attributes(params[resource_instance_name]) set_flash_message!(:notice, '{{resource_name}} was successfully updated.') @@ -74,10 +74,10 @@ end end alias :update! :update # DELETE /resources/1 - def destroy(redirect_url=nil, &block) + def destroy(&block) resource.destroy respond_block, redirect_block = select_block_by_arity(block) set_flash_message!(:notice, '{{resource_name}} was successfully destroyed.')