The short answer is, you can''t - all <% ... %> code is run, then
the page is
displayed.
The long answer is, you could, but there''s probably a better solution.
The
way you could do this is to add an event to the document''s onload event
http://onlinetools.org/articles/unobtrusivejavascript/chapter4.html that
does an ajax call to the controller that renders the partial.
On Sat, Feb 20, 2010 at 3:47 AM, Newb Newb
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
> <td>
> <select id=''userinfo_department_id''
name=''userinfo[department_id]''>
> <% @departmentinfo = Department.find_all_by_company_id(
> @user.company_id, :order => "department_name ASC" ) %>
> <%= render( :partial => ''departments'', :object
=> @departmentinfo,
> :locals => { :userinfo => @user } ) if @departmentinfo %>
> </select>
> <%= observe_field("userinfo_department_id",
> :on => "changed",
> :url => {:action =>
> :update_roles},
> :with =>
> "''department_id=''+value")%>
> </td>
> Dear all
> In my above code all the department gets loaded before the form gets
> loaded.
> I want to render my partial after the document is loaded completely.
> i am not sure how to do this..
> Kindly help me out
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.