-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Custom javascript #187
Comments
I think I got this working by dropping a |
@caseyhelbling But does your main frontend now require your dashboard scripts? I think the plugins need a bit of work (#123) so that we can include custom styles and scripts and enable them to be packaged nicely. My temporary workaround is to do something like this and add the new compiled script to <% content_for :javascript do %>
<%= javascript_include_tag "administrate/froala" %>
<% end %>
|
Hey, folks! Sorry for the delayed response. Yeah, I definitely think this is something we need, and when we settle on a solution we should be able to get it out quickly. A few options:
Thoughts? Other ideas also welcome. |
@rikkipitt - you raise a good concern. I'd like to keep admin-specific js and css separate from the main application's js/css. If an application needs to share styles or scripts across both sides of the app, that will be fairly simple to do with |
Copying assets to Another idea: Have an empty file at |
#573 adds a few helper methods that you can use in an initializer to add stylesheets and javascripts to Administrate.
For an example, see https://github.com/graysonwright/administrate-field-nested_has_many/blob/master/lib/administrate/field/nested_has_many.rb#L12-L14 |
As @Graysonwright mentioned, the way to go is to add those lines in an initializer. After that in /assets/javascript/application.js we can add this line |
@Graysonwright How do we add javascripts to the tree for custom fields? I put a ckeditor.js file that initializes ckeditor in:
app/assets/javascripts/administrate
However, it's not being required by the master administrate application.js
Any ideas? Cheers!
The text was updated successfully, but these errors were encountered: