rails, rest, render different action with responds to
- by Sam
Maybe my logic is not restful or know if this is how you would do it but this is what I am trying to do.
I'm getting a category inside a category controller and then once I get that category I want to return to an index page in a different controller but keep that @category and the Category.busineses.
Before rest I would have just done this:
render :controller = "businesses"
and it would have rendered the view of the index action in that controller.
now in my respond_to block I have this
format.html {redirect_to(business_path)} # index.html.erb
format.xml { render :xml => @businesses }
but of course with a render it looses the instance variable and starts with a new action.
So what I want to do is render the action instead of redirecting to that action.
is this possible?