0

I have a route where the url facebook/get/:id will render a partial, with no layout, of the profile of a person from Facebook with the given id. The function facebook#get expects param[:id] to be set with the id of a profile.

In a different controller I wish to use the partial generated above with out repeating the code found in facebook#get but I am struggling. I have tried variations of render :template => "facebook/get" & render :action => "facebook/get" but nothing is working.

Is it best to figure out how to render this function or just copy the code to the new controller?

3
  • like this? Commented Jun 22, 2016 at 22:23
  • @lusketeer not exactly, I want the code in facebook#get to be ran, which this does not do Commented Jun 22, 2016 at 22:28
  • 1
    not sure I follow, why not just use the same partial in the desired controller action view, and just pass in the object as one of the locals, post some codes of controllers and partials would help Commented Jun 22, 2016 at 22:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.