On Thu, Feb 11, 2010 at 1:33 PM, Marnen Laibow-Koser
<[email protected]> wrote:
>> get_user.rjs:
>>
>> if @user
>>   page.replace_html 'user_tab', :partial => 'user/user_form'
>>   page << "$j( '#user_tab' ).fadeIn('slow');"
>> end
>
> Hmm.  Why the visual effect here, rather than in the completion handler
> for the Ajax call?

Because I build more than just toy apps.  Sometimes I have complex
logic for what effect to show, or what to do when an exception is
raised.  Sometimes the JS is generated, like:

page << "$j(function(){ $j.notifyBar({ html: '#{ "Enrollment goals
updated" }', delay: #{ FLASH_EXPIRE_DELAY }, animationSpeed: 'normal'
}); });"

> I guess I don't see the point of Rails writing JS,

I agree, you do not.


-- 
Greg Donald
destiney.com | gregdonald.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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to