On Jueves, 4 de Junio de 2009 19:08:59 [email protected] escribió:
> Thanks a bunch!
>
> Just for the record: i copied _create_form.rhtml into my view and
> modified the javascript section as follows:
>
> <script type="text/javascript">
> <% if logged_in? %>
> Form.Element.focus('record_notes').select();
> <% else %>
> Form.focusFirstElement('<%= element_form_id(:action => :create) -
> %>');
> <% end %>
> </script>
It would be better to call render :super and add the javascript:
<%= render :super %>
<script type="text/javascript">
<% if logged_in? %>
Form.Element.focus('record_notes').select();
<% else %>
Form.focusFirstElement('<%= element_form_id(:action => :create) -
%>');
<% end %>
</script>
--
Sergio Cambra .:: entreCables S.L. ::.
Nicolás Guillén 6, locales 2 y 3. 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---