The issue here can be traced back to extensions/action_view_rendering.rb line 76. As you can see here:
https://github.com/activescaffold/active_scaffold/blob/master/lib/active_scaffold/extensions/action_view_rendering.rb#L76 You are wrong about simply specifying the path to the controller. As you can see from the code above, the controller's name is substituted and singularized to form an 'expected' model name. In fact, if you read the comments written directly into the code, you see it says: # parse the ActiveRecord model name from the controller path, which # might be a namespaced controller (e.g., 'admin/admins') So you see, the problem is in fact here in ActiveScaffold. I will work on the core code and see if I can fix this myself. Will submit PR when appropriate. -Jason > On Feb 19, 2016, at 10:47 PM, Jim <[email protected]> wrote: > > When rendering an embedded scaffold, you specify the controller, not the > object. So for example, to render the scaffold defined in > Admin::PriceListsController as an embedded scaffold, I call it like this: > > <%= render(active_scaffold: 'admin/price_lists', constraints: { event: > @event.id }, params: {id: nil} ) %> > > Jim Crate > > On Thursday, February 18, 2016 at 8:55:52 PM UTC-5, Jason FB wrote: > I'm having some difficulty adding some namespacing to objects I use with > ActiveScaffold > > > I have a subview, shown here in haml, that works for a join table called > blocks_pages. (It has a corresponding ruby object BlocksPage) > > = render :active_scaffold => 'blocks_pages', :params => { id: nil }, > :constraints => { :page_id => @record.id } > > > I'd like to rename this object to Platform::BlocksPage, but when I do so, I > get this: > > uninitialized constant BlocksPage > > I need a way to tell Active Scaffold that the object I want to use is the > Platform::BlocksPage object, and not the BlockPage object. I tried various > iterations of using the ruby object's name as the string passed to the > :active_scaffold parameter, and also I tried 'platform/blocks_pages' but this > did not work. > > Any suggestions? > -Jason > > > > > > > ---- > > Jason Fleetwood-Boldt > [email protected] > http://www.jasonfleetwoodboldt.com/writing > > If you'd like to reply by encrypted email you can find my public key on > jasonfleetwoodboldt.com (more about setting GPG: https://gpgtools.org) > > > -- > You received this message because you are subscribed to the Google Groups > "ActiveScaffold : Ruby on Rails Gem" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/activescaffold. > For more options, visit https://groups.google.com/d/optout. ---- Jason Fleetwood-Boldt [email protected] http://www.jasonfleetwoodboldt.com/writing If you'd like to reply by encrypted email you can find my public key on jasonfleetwoodboldt.com (more about setting GPG: https://gpgtools.org) -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails Gem" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/activescaffold. For more options, visit https://groups.google.com/d/optout.
