-
Notifications
You must be signed in to change notification settings - Fork 330
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
config.columns[:script].css_class = 'ace_script_editor' #501
Comments
The class is added to li, in some cases someone may want to set styles for dt, dd or label, so it's more flexible to add class to li. |
Hi Sergio. Yeah, that works..but only if I put it into the javascript console. Doesn't this selector need to be in the page's eval for that new fame? If I put this: $('.ace_script_editor textarea').ace({ theme: 'twilight', lang: 'ruby' }) in application.js it doesn't seem to activate it. Is there a way to insert javascript in the AS nested scaffold for a given controller? Thanks in advance. |
ActiveScaffold has some events which are triggered when something is added or replace, you can add listener for them and activate ace there. https://github.com/activescaffold/active_scaffold/wiki/Javascript-Events-and-Customization Events should be explained better on that page, but you can get the idea. There are three events:
|
I seem to be having a bit of a problem setting the desired css class name to a textarea using AS:
It doesn't seem to be setting the css class (see attached).
Is there any known problem using this method?
Also, if I wanted to set a jquery call for this page where would the best place be to do this for just an AS view?
If the below is called it will transform the textarea into a nice code editor!
$('.script-input').ace({ theme: 'twilight', lang: 'ruby' })
Thanks in advance,
Mark
The text was updated successfully, but these errors were encountered: