Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving 'template-upload' and 'template-download' JQuery templates outside the index.html.erb page #20

Open
amitjambusaria opened this issue Jul 12, 2013 · 1 comment

Comments

@amitjambusaria
Copy link

I am trying to move out the 'template-upload' and 'template-download' script to a separate .js file. They seem to be Jquery templates. How can you move them to a different file and then use them in the index.html.erb page

@mikbe
Copy link

mikbe commented Nov 10, 2014

They aren't Javascript files but here's how to do it:

  1. Create two new files _upload_template.html and _download_template.html.
  2. Cut and past the upload and download template code from index to those files respectively.
  3. Add <%= render "upload_template" %> and <%= render "download_template" %> to index where the old template code was.

You can see my updated example here (it also fixes the missing thumbnails):
https:/mikbe/jquery-fileupload-rails-paperclip-example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants