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

Admin layout generation? #258

Closed
nextekcarl opened this issue Nov 20, 2015 · 8 comments
Closed

Admin layout generation? #258

nextekcarl opened this issue Nov 20, 2015 · 8 comments

Comments

@nextekcarl
Copy link

I'm working on integrating the Cloudinary heroku addon and I need to get that gem to include the javascript files that it normally adds by adding:

//= require cloudinary

...to the application.js manifest, but it appears that's all ignored when I'm in the administrate Rails engine. Where does the layout live for Administrate? I don't see a way listed to generate that layout that Administrate uses so that I can make changes to it the same way I can with the resource specific views, etc.

And while I can use the content_for :javascripts helper to add the javascript for cloudinary things directly, I'm pretty sure that will break when I move it to Heroku due to the SHA that added during precompile, won't it? So where do I add the require statement above to get it to get it added to the asset pipeline used in Administrate?

@c-lliope
Copy link
Contributor

Thanks, @nextekcarl! It looks like there's a bit of overlap with #187 here. We're hoping to add generators for SCSS and JS soon, but until then you should be able to overwrite a few files to get it working.

@nextekcarl
Copy link
Author

Sorry, comment was messed up there so I deleted to and I'll try again:

I guess I'm just not sure who I'd translate the work done by //= require cloudinary in the app manifest into a simple content for block and expect it to work wince this method doesn't add the SHAs:

<% content_for :javascript do %>
<%= javascript_include_tag("jquery.ui.widget", "jquery.iframe-transport",
"jquery.fileupload", "jquery.cloudinary") %>
<%= cloudinary_js_config %>
<% end %>

Any help is appreciated.

@c-lliope
Copy link
Contributor

Hm... you may be able to copy this file into your app at app/assets/javascripts/administrate/application.js, and then add the //= require statement in there.

Does that solve the problem?

@nextekcarl
Copy link
Author

Yes, I think that did, thanks!

@c-lliope
Copy link
Contributor

Great! I'll work on a generator to make that process easier.

@nextekcarl
Copy link
Author

We can generate the files used for views, but not for the layout. How do do we modify the favicon, or change the actual layout outside of the specific content_for blocks included already? I guess you could include content for blocks for each section, but that feels kind of clunky over just generating the layouts the same way we generate the views for resources, but I don't see a way to do that.

@c-lliope
Copy link
Contributor

@nextekcarl I just merged in #269, which adds rails generate administrate:views:layout. It'll go out in version 0.1.3, and until then you can get it by using

gem "administrate", github: "thoughtbot/administrate"

Cheers!

@nextekcarl
Copy link
Author

Woohoo!

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