I'm trying to generate a URL for a model which is namespaced from a controller which is not. For example:
module SomeStuff
class Widget < ActiveRecord::Base; end
end
class WidgetsController < ApplicationController
def create
w = Widget.create(params)
location = url_for w
render :json => w, :location => location
end
end
The problem is Rails wants a "some_stuff_widget_path" to exist and it doesn't because the controller is not namespaced. I tried the solutions given in another post (http://stackoverflow.com/questions/4404440/rails-url-for-and-namespaced-models) but they didn't seem to work.
My models are technically in a separate gem which is namespaced and then my Rails app includes that gem and provides controllers. Without changing that setup, is there a way to get "url_for" to work?