Hi,

Does anyone have any thoughts on a cleaner way to achieve the
following in a controller ...

def show
    if  current_user.can_access_organisation(params[:id])
      @organisation = Organisation.find(params[:id])
    end
    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @organisation }
    end
end

As you can see I am testing to make sure the current user is able to
access an organisation, however the site breaks when the test is
broken which doesn't look very nice.

Any ideas much appreciated.

Richie.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to