concept edit in category rails

This is an excerpt from Manning's book Rails 4 in Action: Revised Edition of Rails 3 in Action.
For this action, you’re working with a preexisting object rather than a new object, which you used in the new action. This preexisting object is found by the edit action in PurchasesController, as shown here.
Oops: it’s not here! The code to find the @purchase object is identical to what you saw earlier in the show action: it’s set in before_action, which runs before the show, edit, update, and destroy actions.
Back in the view for a moment, at the bottom of it you can see two uses of link_to. The first creates a “Show” link, linking to the @purchase object, which is set up in the edit action of your controller. Clicking this link would take you to purchase_path(@purchase) or /purchases/:id. Rails will figure out where the link needs to go according to the class of the object given. Using this syntax, it will attempt to call the purchase_path method because the object has a class of Purchase, and it will pass the object along to that call, generating the URL.
With the first two parts of CRUD (creating and reading) done, you’re ready for the third part: updating. Updating is similar to creating and reading in that it has two actions for each part (creation has new and create; reading has index and show). The two actions for updating are edit and update.
Let’s begin by writing a feature and creating the edit action.
As with the form used for creating new projects, you want a form that allows users to edit the information of a project that already exists. You first put an “Edit Project” link on the show page that takes users to the edit action, where they can edit the project. Put the code from the following listing into spec/features/editing_projects_spec.rb.
1) Users can edit existing projects with valid attributes Failure/Error: click_link "Edit Project" ActionView::MissingTemplate: Missing template projects/edit, application/edit with { :locale => [:en], :formats => [:html], :variants => [], :handlers => [:erb, :builder, :raw, :ruby, :coffee, :jbuilder] }. Searched in: * ".../ticketee/app/views"It looks like you need to create this template. The edit action’s form is similar to the form in the new action—if only there were a way to extract out just the form into its own template. Well, in Rails, there is! You can extract out the form from app/views/projects/new.html.erb into what’s called a partial. You saw partials briefly in chapter 1.

This is an excerpt from Manning's book Rails 3 in Action.
For this action, you’re working with a pre-existing object rather than a new object, which you used in new. This pre-existing object is found by the edit action in PurchasesController, shown in the next listing.
Listing 8.9. Update tests for spec/controllers/tickets_controller_spec.rb
it "cannot edit a ticket without permission" do get :edit, { :project_id => project.id, :id => ticket.id } cannot_update_tickets! end it "cannot update a ticket without permission" do put :update, { :project_id => project.id, :id => ticket.id, :ticket => {} } cannot_update_tickets! end