阅读背景:

调用在Rails控制器中有条件地呈现视图的方法

来源:互联网 

I am writing a Ruby on Rails application with a controller called "pages_controller" that is responsible for displaying pages to users. There are 3 different types of pages that can be displayed, and different things have to happen on the back end in each case, so I decided to break the functionality out into 3 methods within the controller. When the user requests a page, the "show" method is called, which figures out whether the page: 1. Belongs to the user 2. Belongs to another user, and can be viewed by the user requesting it 3. Belongs to another user, and cannot be viewed by the user requesting it (unauthorized)I am writing a Ruby on Rails application with a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: