I’m having a strange issue where all the links on my page are going to a 
strange route (specifically, a route that exists in my app but is not 
associated with AS in any way, see below)


My page loads correctly at:

http://127.0.0.1:3000/admin/scaffold/orders 
<http://127.0.0.1:3000/admin/scaffold/orders>

Every link (Edit, Search, all the pagination links) go to something like:

http://127.0.0.1:3000/orders/populate?action=edit&controller=admin_scaffold%2Forders&id=R345160226

/orders/populate is a route in my app, but it has nothing to do with Active 
Scaffold. As far as I can see, the links should be simply to 
/admin/scaffold/orders, but for some reason they are coming out to 
/orders/populate.

Any clues as to what is happening here?

Thanks,
Jason



My routes file has this entry:

namespace :admin do
  namespace :scaffold do
    resources :orders do
      as_routes
    end
  end
end



Here’s the AS controller:

class Admin::Scaffold::OrdersController < Admin::Scaffold::BaseController
  active_scaffold "Spree::Order" do |config|
    config.actions = [:list, :update, :field_search]
    config.label = "Orders"
    config.columns = [:number, :state, :email, :item_total, :adjustment_total, 
:total,
                    :channel, :completed_at, :is_gift, :last_ip_address, 
:payment_state, :shipment_state,
                :special_instructions, :order_date, :update_at]
    list.columns = [:number, :state, :item_total, :adjustment_total, :total ]
    list.sorting = {:id => 'ASC'}
  end
end



Here’s the base class to that object:

class Admin::Scaffold::BaseController < Spree::BaseController

  layout 'admin/scaffold/layouts/admin_application.html.erb'
  protected

  def self.active_scaffold_controller_for(klass)
    return "Spree::#{klass}Controller".constantize rescue super
  end
end







-- 
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 http://groups.google.com/group/activescaffold.
For more options, visit https://groups.google.com/d/optout.

Reply via email to