bernat/best_in_place — Issue #54: problem when controller is inside namespace
Author: reyjexter
Created: 2011-12-11 06:02:21+00:00
State: open

I've been trying to implement best_in_place on my app for 2 weeks now but couldn't find a solution so I'm posting here. Anyway, I have the following code on view

<%= best_in_place [:admin, smiley], :tags %>

But I kept getting this error:

NoMethodError in Admin/smileys#index

Showing /Users/myuser/workspace/rails/myapp/app/views/admin/smileys/index.html.erb where line #32 raised:

undefined method `tags' for #

When using simple code:

<%= smiley.tags %>

It prints correct data so I think this is not a case where smiley object doesn't exit.

Anyway I have my controller inside a namespace. Here's the definition

class Admin::SmileysController < ApplicationController
before_filter :authenticate_user!
load_and_authorize_resource
layout "admin"
...

The controller was generated by rails scaffold command although i made some modification but shouldn't affect how best_in_place works.

I'm also using the following things:

Ruby: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
Rails: 3.1.3
Rake: rake 0.9.2.2