0

I'm having weird issue. I'm getting RAW Javascript Code when URL is having .js in URL.

http://www.test.com/documents.js?list_type=index&page=2

Any idea, why it is behaving like this?

def index 
  Query to fetch documents

  respond_to do |format|
    format.html
    format.js
  end
end

on check-box click, calling a JQUERY to load Documents partial:

$.get('/documents.js', window.search_filter);

1 Answer 1

0

Likely because you have a file called documents.js in your public folder.

Rails will look in public for the requested file before it goes to your routes file.

Similar to when you have to remove index.html from public in order to get started on your app.

1
  • No - I dont have documents.js in my public folder
    – kashif
    Commented Sep 10, 2014 at 13:31

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.