Users action show & disable plugins #1651

Closed
gustavolobo opened this Issue May 11, 2012 · 8 comments

Comments

Projects
None yet
3 participants

I have two questions:

  1. First, I would like to know how can I add the action users#show. When I do it, the action users#new stops working, because action new is seen as an id.
  2. Second, is there any easy way to disable plugins ? I want to disable Files, for example.
Owner

parndt commented May 12, 2012

  1. Do you mean to add show to
  2. How do you mean disable? As in, remove that functionality from each users or remove it completely?
    • From each user: edit the user in the backend and uncheck the box "Files" and save
    • Completely: you have to build a custom stack of Refinery for example in your Gemfile remove gem 'refinerycms', '~> 2.0.3' and replace with:
gem 'refinerycms-pages', '~> 2.0.3'
gem 'refinerycms-images', '~> 2.0.3'
gem 'refinerycms-dashboard', '~> 2.0.3'
gem 'refinerycms-authentication', '~> 2.0.3'
  1. add show to https://github.com/resolve/refinerycms/blob/2-0-stable/authentication/app/controllers/refinery/admin/users_controller.rb
  2. Completely. But when I do it, the server doesn't run because resources tries to start and fail.
Owner

parndt commented May 16, 2012

  1. I think you have to route to it too. Notice we specifically exclude it: https://github.com/resolve/refinerycms/blob/master/authentication/config/routes.rb#L33-L35

In your routes file try this:

  namespace :admin, :path => 'refinery' do
    resources :users, :only => :show
  end  
  1. Why does resources try to start? Can you give a strack trace please?
  1. Thank you, I was doing it wrong :)
  2. rails s
=> Booting WEBrick
=> Rails 3.2.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/refinerycms-images-2.0.3/lib/refinery/images/dragonfly.rb:41:in `attach!': uninitialized constant Refinery::Resources (NameError)
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/refinerycms-images-2.0.3/lib/refinery/images/engine.rb:13:in `block in <class:Engine>'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/gustavolobo/Projects/(…)/config/environment.rb:5:in `<top (required)>'
    from /Users/gustavolobo/Projects/(…)/config.ru:4:in `block in <main>'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
    from /Users/gustavolobo/Projects/(…)/config.ru:1:in `new'
    from /Users/gustavolobo/Projects/(…)/config.ru:1:in `<main>'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/commands/server.rb:46:in `app'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/commands/server.rb:70:in `start'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/commands.rb:55:in `block in <top (required)>'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
    from /Users/gustavolobo/.rvm/gems/ruby-1.9.3-p125@(…)/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

parndt added a commit that referenced this issue May 16, 2012

@ugisozols ugisozols closed this May 16, 2012

Owner

parndt commented May 16, 2012

You found a bug! I've just committed a solution and will have to release 2.0.5 for that.

parndt added a commit that referenced this issue May 16, 2012

ugisozols added a commit that referenced this issue May 17, 2012

ugisozols added a commit that referenced this issue May 17, 2012

When do you release the 2.0.5 ?

Owner

ugisozols commented May 24, 2012

@parndt wdyt? @gustavolobo for now you can point refinerycms gem in your Gemfile to this repo and specify 2-0-stable branch.

Ok, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment