0

I'm trying to render one view (index) from one controller to the view of another controller. index needs to calculate some values in the controller and render the view.

How do I do this?

example: in products/list I have

<%= render :partial=>"admin/index" %>

and in admin_controller:

def index
   @member = something
end

looks like the code in admin/controller never gets executed.

Thank you!

user1404536
  • 1,101
  • 3
  • 10
  • 17

1 Answers1

1

Render will just render the view, it won't run the action associated with it.

You have to copy this:

   @member = something

to your products/list action.

Hesham
  • 2,327
  • 2
  • 20
  • 24