Skip to content

Controller namespace generator #17

@sam-kim

Description

@sam-kim

Follow up to #16

Ran into this when generating a controller with a namespace, ex bin/rails g scaffold admin/projects. I ran into a small issue while working with the accessible_by_user and my workaround is creating a minor inconvenient 🐛 .

Running the command will render:

  def index
    @admin_projects = Admin_project.accessible_by_user(current_user).all
  end

  ...

  def set_admin_project
    @admin_project = Admin_project.accessible_by_user(current_user).find(params[:id])
  end

While everything else on the controller is of this format:

  def new
    @admin_project = Admin::Project.new
  end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions