Disambiguating by breaking more conventions#3
Conversation
There was a problem hiding this comment.
unexpected token tLT
unterminated string meets end of file
There was a problem hiding this comment.
unexpected token tIDENTIFIER
unterminated string meets end of file
There was a problem hiding this comment.
unexpected token tIDENTIFIER
unexpected token tRPAREN
There was a problem hiding this comment.
unexpected token tLT
unexpected token tRPAREN
There was a problem hiding this comment.
unexpected token tIDENTIFIER
unexpected token tOP_ASGN
There was a problem hiding this comment.
unexpected token tOP_ASGN
unexpected token tIDENTIFIER
22711f0 to
e594291
Compare
- Removing all instance variables to decouple variable name choices between actions that re-use templates, and to remove the additional cognitive load of learning what an instance variable is. Also, avoiding state is better practice anyway, IMO. - Using strings as keys to the `params` hash following the heuristic: "If we could change it to 'zebra' on a whim, then use a string; otherwise use a symbol." - Making variable and input names longer and more pedantic.
e594291 to
eebc1c7
Compare
There was a problem hiding this comment.
unexpected token tIDENTIFIER
unterminated string meets end of file
|
|
||
| <% unless skip_validation_alerts? -%> | ||
| redirect_to("/<%= @plural_table_name.underscore %>", :notice => "<%= singular_table_name.humanize %> deleted successfully.") | ||
| redirect_to("/<%= plural_table_name %>", :notice => "<%= singular_table_name.humanize %> deleted successfully.") |
There was a problem hiding this comment.
unexpected token tIDENTIFIER
unexpected token tRPAREN
There was a problem hiding this comment.
unexpected token tIDENTIFIER
unexpected token tLCURLY
There was a problem hiding this comment.
unexpected token tLT
unexpected token tRPAREN
There was a problem hiding this comment.
unexpected token tIDENTIFIER
unexpected token tOP_ASGN
There was a problem hiding this comment.
unexpected token tOP_ASGN
unexpected token tIDENTIFIER
| @<%= singular_table_name.underscore %> = <%= class_name.singularize %>.find(params[:id]) | ||
| id_of_<%= singular_table_name %>_to_show = params.fetch("id_to_display") | ||
|
|
||
| @<%= singular_table_name %>_to_show = <%= class_name.singularize %>.find(id_of_<%= singular_table_name %>_to_show) |
|
|
||
| def show | ||
| @<%= singular_table_name.underscore %> = <%= class_name.singularize %>.find(params[:id]) | ||
| id_of_<%= singular_table_name %>_to_show = params.fetch("id_to_display") |
| id_of_<%= singular_table_name %>_to_show = params.fetch("id_to_display") | ||
|
|
||
| render("<%= plural_table_name.underscore %>_templates/show.html.erb") | ||
| @<%= singular_table_name %>_to_show = <%= class_name.singularize %>.find(id_of_<%= singular_table_name %>_to_show) |
|
|
||
| def show | ||
| @<%= singular_table_name.underscore %> = <%= class_name.singularize %>.find(params[:id_to_display]) | ||
| id_of_<%= singular_table_name %>_to_show = params.fetch("id_to_display") |
| class <%= plural_table_name.camelize %>Controller < ApplicationController | ||
| def index | ||
| @<%= plural_table_name.underscore %> = <%= class_name.singularize %>.all | ||
| @list_of_<%= plural_table_name %> = <%= class_name.singularize %>.all.order({ :created_at => :desc }) |
| %w(index show new_form create_row edit_form update_row destroy_row) | ||
| else | ||
| %w(index new_form edit_form show) | ||
| %w(index show new_form new_form_with_errors edit_form edit_form_with_errors) |
|
|
||
| template "specs/crud_spec.rb", "spec/features/crud_#{plural_table_name.underscore}_spec.rb" | ||
| template "specs/factories.rb", "spec/factories/#{plural_table_name.underscore}.rb" | ||
| template "specs/crud_spec.rb", "spec/features/crud_#{plural_table_name}_spec.rb" |
| available_views.each do |view| | ||
| filename = view_filename_with_extensions(view) | ||
| template filename, File.join("app/views", "#{plural_table_name}_templates", File.basename(filename)) | ||
| template filename, File.join("app/views", "#{singular_table_name}_templates", File.basename(filename)) |
| template "controllers/read_only_controller.rb", "app/controllers/#{plural_table_name}_controller.rb" | ||
| else | ||
| template "controllers/controller.rb", "app/controllers/#{plural_table_name.underscore}_controller.rb" | ||
| template "controllers/controller.rb", "app/controllers/#{plural_table_name}_controller.rb" |
|
|
||
| if read_only? | ||
| template "controllers/read_only_controller.rb", "app/controllers/#{plural_table_name.underscore}_controller.rb" | ||
| template "controllers/read_only_controller.rb", "app/controllers/#{plural_table_name}_controller.rb" |
* Add github login * #3 - Fixed failing test * #3 - Fixed other test cases * #3 - Minor changes * #3 - Indentation fixes * #3 Added .rubocop.yml and fixed rubocop issues * #3 - Test cases for https://github.com/firstdraft/ideas/pull/3 * #3 - CicleCi add minitest_globs and fixed rubocop issues * #3 - Added bootswatch paper theme * #3 - Turn off hound ci for js, css * we do not recommend using capybara * added database yml to gitignore * added database yml sample file for postgresqlapp * #3 - Removed rspec completely * #3 - Remove Factory Girl and instead uses fixtures * #3 - Updated CircleCi.yml and modified setup script * #3 - Added database.yml.ci * #3 - Review comments changes
between actions that re-use templates, and to remove the additional
cognitive load of learning what an instance variable is. Also,
avoiding state is better practice anyway, IMO.
paramshash following the heuristic:"If we could change it to 'zebra' on a whim, then use a string;
otherwise use a symbol."