1

I have next mistake: Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect

here

respond_to do |format| format.html { render layout:"productView" render "show2" } ajax_respond format, :section_id => "user_tab_comments" format.js end 

So I want to render both layout and view, what am I doing wrong?

1
  • Well, you are rendering them both as 2 separate responses to one request. One request -- one response. You need to stuff them in a single render-directive. Commented Jun 7, 2015 at 8:25

1 Answer 1

3

Use like this instead of double render:

 render :show2, layout: 'productView' 

And layout page should be under app/views/layouts/ Hope it works.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.