I use flash to tell the user if they logged in correctly or not, is there a way to put in the jquery code to fade after so many seconds or is there a way to do it with just the flash command?
Here is what im talking about
def login
@title = "Log in to Connect my Friends"
if param_posted?(:user)
@user = User.new(params[:user])
user = User.find_by_screen_name_and_password(@user.screen_name,
@user.password)
if user
user.login!(session)
flash[:notice] = "User #{user.screen_name} logged in!"
redirect_to_forwarding_url
else
@user.clear_password!
flash[:notice] = "Invalid screen name/password combination"
end
end
end
See http://snippets.dzone.com/posts/show/5271 for several examples of how to accomplish this.
Another example here: http://bjhess.com/blog/fading-flash-message/