1

I have this method in my videos controller:

def notification_go
  current_user.render_read
  respond_to do |format|
    format.html
    format.js { render 'notification_go.js.erb' }
  end
end

It is not rendering my notification_go.js.erb file in my videos view directory. Why is this? How do I render it?

(My notification_go method is called via an AJAX request. Not sure if that makes any difference.)

1
  • Did you try render 'notification_go'? May 9, 2011 at 7:25

2 Answers 2

2

you dont need to specify render 'notification_go.js.erb' by default its already been mapped, the filename of notification_go.js.erb template with controller action notication_go

def notification_go
  current_user.render_read
  respond_to do |format|
    format.html
    format.js
  end
end
1

Try passing

:format => :js 

to path in your AJAX request.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.