[Boulder Ruby Group] rendering now!

ara.t.howard ara.t.howard at gmail.com
Fri Jun 29 01:37:27 EDT 2007


On Jun 28, 2007, at 11:32 PM, Brian Rose wrote:

> I might be misunderstanding, but if the problem is a double render,  
> just return the render:
>
>
> before_filter :authenticate
>
> def authenticate
>   self.current_user ||= (session[:user] && User.find_by_id(session 
> [:user])) || false
>   return redirect_to(login_path) unless current_user
> end


that's precisely how i ended up double rendering while testing my  
code ;-)

def action_that_needs_authentication
   authenticate
   render
end


cheers.

-a
--
we can deny everything, except that we have the possibility of being  
better. simply reflect on that.
h.h. the 14th dalai lama



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/bdrg-members/attachments/20070628/5948af60/attachment.html 


More information about the Bdrg-members mailing list