Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing the show method and all of its dependencies

I have an existing entity that has been created by scaffolding. Now I'm realizing that I don't really need to present the show view and thus I'd like to eliminate any methods and pieces that are now unnecessary. Besides the show method created at the object controller for me, which other pieces should I remove? These are the ones I can think of:

  • The show.html.erb file for the entity
  • The link_to reference to the object instances at the index.html.erb and edit.html.erb files
  • The redirect_to calls on the update and create methods at the controller

Is there anything else that I should remove?

like image 758
wotaskd Avatar asked Dec 21 '22 20:12

wotaskd


1 Answers

You should:

  • Remove the show action from the controller
  • Switch the redirect_tos in create and update to go to the new action
  • Remove the link_tos from index.html.erb and edit.html.erb
  • Remove the app/views/entities/show.html.erb
  • Stop the routes from being generated by changing the resources :entities line in your config/routes.rb file to resources :entities, :except => :show
like image 194
Ryan Bigg Avatar answered Jan 19 '23 19:01

Ryan Bigg