rails-conventions

Installation
SKILL.md

Rails Conventions

This skill only covers what an agent got wrong without it in baseline tests. Everything else is standard Rails 8 practice, which the agent already follows. Where a project's own code or docs/conventions/ disagrees, follow the project.

Rules

  • Flash wording: notice: 'Successfully Created Widget', 'Successfully Updated Widget', 'Successfully Deleted Widget'. Use alert: for failures.

  • Failed saves: render :new, status: :unprocessable_content, never :unprocessable_entity, which is the deprecated name for the same 422.

  • Forms: always simple_form_for and simple_fields_for, never form_with or form_for. Non-model forms use a symbol: simple_form_for :search, url: widgets_path, method: :get, which nests params under :search.

  • Route concerns pass the parent type with parent_resource.name.classify, not a hard-coded string or a concern option:

    concern :commentable do
      resources :comments, commentable_type: parent_resource.name.classify
    end
    
Installs
1
GitHub Stars
7
First Seen
2 days ago
Security Audits