2010/8/25 Tom Mac <[email protected]>
> Hi
> I have the code
>
> def index
> @messages = message_thread.messages
> end
>
> private
>
> def message_thread
> begin
> current_user.message_threads.find(params[:thread_id])
> rescue ActiveRecord::RecordNotFound
>
The problem is here:
> logger.warn "No permission or thread_id nil"
> render :file => "#{RAILS_ROOT}/public/404.html"
> end
> end
>
>
> And even if params[:id] does not have any values I dont get any
> exception . I can't figureout why. Please help
>
You have a rescue statement which is overriding the exception:
current_user.message_threads.find(params[:thread_id]) rescue
ActiveRecord::RecordNotFound
remove the rescue first you will see an exception.
>
> Thanks
>
---
Edmond
Software Developer | Baobab Health Trust (http://www.baobabhealth.org/) |
Malawi
Cell: +265 999 465 137 | +265 881 234 717
*"Many people doubt open source software and probably don’t realize that
there is an alternative… which is just as good.." -- Kevin Scannell*
--
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.