Closed maziz closed 10 years ago
this is happening to me too
I also reported this as an issue to active_admin.
Here's a workaround:
Looksee.rename(:edit => 'looksee_edit')
This is also an issue if you have modules with the action edit
and include them in a controller.
Let's say you have:
#Accounts edit
module AccountsEditor
def edit
@account = Account.new
render partial: 'edit'
end
And then:
class UserAccountController < ApplicationController
include AccountsEditor
def index
@users = Users.all
end
end
Before require 'looksee'
:
UserAccountController.action_methods
#<Set: {"index", "edit"}>
After:
UserAccountController.action_methods
#<Set: {"index"}>
Although @skyjumper suggested a great workaround I don't think this small issue should prevent us from using this awesome gem.
What do you think @oggy?
Sorry for the long delay.
I hear you guys - method collisions are never fun. Looksee.rename
was intended for exactly these sorts of use cases, but I get that edit
was a particularly bad choice due to Rails controller conventions.
I'll get on this. My latest thought is to do object.ls.edit
rather than object.edit
. The idea being that everything Looksee does should be "namespaced" under ls
(which can still be rename
-d). Let me know if any thoughts.
:+1: on the namespaced edit under ls
Pushed this in v2.0.0.
When used alongwith ActiveAdmin gem, the Edit views (of entities registered in admin) always raise this error:
Unknown action
AbstractController::ActionNotFound
( My setup : Rails 3.1.3 , Ruby 1.9.3 , rbEnv )