0

Hi I'm making a Widget which display a page from rails application in Iframe. Since the remote page was developed in rails, On rendering single page on Iframe, It loads all the JS and CSS file so page on iFrame takes too much time to load.

I was trying to use layout: false while rendering the page but it doesn't load any of its JS and CSS file.

Is there any way to include specific JS and CSS file in rails view?

7
  • Create a separate layout for the widget page, avoid mixing up the CSS and JS files of the widget with the CSS and JS files of your Rails app Commented Sep 15, 2015 at 8:02
  • Hi sounds great!!! What about the Vendor'file? Commented Sep 15, 2015 at 8:05
  • What vendor file are you using? Commented Sep 15, 2015 at 8:09
  • possible duplicate of Using Rails 3.1, where do you put your "page specific" javascript code? Commented Sep 15, 2015 at 8:10
  • 1
    Okey thank you very much. You made my day Commented Sep 15, 2015 at 8:13

1 Answer 1

2

On a page you can write to include stylesheet as

<%= stylesheet_link_tag 'filename' %>
## If your file reside under any folder then you have to write 'foldername/filename'

and you can include javascript file as:

<%= javascript_include_tag 'filename' %>
Sign up to request clarification or add additional context in comments.

Comments

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.