Skip to content

Commit

Permalink
Slim down comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Jan 24, 2021
1 parent c033501 commit f303dd9
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lib/generators/rails/templates/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
class <%= controller_class_name %>Controller < ApplicationController
before_action :set_<%= singular_table_name %>, only: %i[ show edit update destroy ]
# GET <%= route_url %>
# GET <%= route_url %>.json
# GET <%= route_url %> or <%= route_url %>.json
def index
@<%= plural_table_name %> = <%= orm_class.all(class_name) %>
end
# GET <%= route_url %>/1
# GET <%= route_url %>/1.json
# GET <%= route_url %>/1 or <%= route_url %>/1.json
def show
end
Expand All @@ -26,8 +24,7 @@ def new
def edit
end
# POST <%= route_url %>
# POST <%= route_url %>.json
# POST <%= route_url %> or <%= route_url %>.json
def create
@<%= singular_table_name %> = <%= orm_class.build(class_name, "#{singular_table_name}_params") %>

Expand All @@ -42,8 +39,7 @@ def create
end
end
# PATCH/PUT <%= route_url %>/1
# PATCH/PUT <%= route_url %>/1.json
# PATCH/PUT <%= route_url %>/1 or <%= route_url %>/1.json
def update
respond_to do |format|
if @<%= orm_instance.update("#{singular_table_name}_params") %>
Expand All @@ -56,8 +52,7 @@ def update
end
end
# DELETE <%= route_url %>/1
# DELETE <%= route_url %>/1.json
# DELETE <%= route_url %>/1 or <%= route_url %>/1.json
def destroy
@<%= orm_instance.destroy %>
respond_to do |format|
Expand Down

0 comments on commit f303dd9

Please sign in to comment.