Routing except and only

2010-05-02  来源:本站原创  分类:Ruby  人气:180 

# Only generate the :index route of articles
map.resources :articles, :only => :index

# Generate all but the destroy route of articles
map.resources :articles, :except => :destroy

# Only generate the non-modifying routes of articles
map.resources :articles, :only => [:index, :show]

# Don't generate any default article routes, just the approve route
map.resources :articles, :except => :all, :member => { :approve => :put }

# Same
map.resources :articles, :only => :none, :member => { :approve => :put }
相关文章
  • Ruby on Rails Routing - Simple Examples 2009-02-27

    This article contains a list of ruby on rails routing examples. If you find you have any questions please leave a comment. Routes are processed from the top of routes.rb down. If a route is matched it will stop processing the routes.rb file and use t

  • Rest of Rails routing 2009-03-15

    In the rails application, routes.rb routing has three main ways. 1: map.connect # for routing the admin/customers section map.connect '/superadmin/user_asset/list_assets', :controller => "superadmin/user_asset",:action=>'list_assets' map.c

  • Dynamic DataSource Routing --- Spring to connect multiple data sources 2010-03-20

    Copied from: http://blog.springsource.com/2007/01/23/dynamic-datasource-routing/ Spring 2.0.1 introduced an AbstractRoutingDataSource. I believe that it deserves attention, since (based on frequent questions from clients) I have a hunch that there ar

  • Routing table Xiangjie 2010-03-02

    Routing table shows (Xiangjie route print) Read nello routing table, to get this piece of paper, a more detailed explanation of the routing table, this is quite common, and share Routing table shows --------------------------------------------------

  • Solve the routing loop problem [reproduced a case Tutorial] 2010-03-02

    Three switches in a set number of VLAN, each VLAN are configured with a sub-IP address of the gateway, and set the default route to point broadband routing; associated with the broadband Internet to set a static route routing , used to enter the data

  • Routing algorithm - packet switching buffer map 2010-02-21

    Routing algorithm - packet switching buffer map

  • Bind more than one network card with static IP routing 2010-04-06

    System Environment: CentOS 5 1, bind more than one network card IP Build configuration file ifcfg-ethX-rangeX: IPADDR_START = start ip IPADDR_END = end of the ip vi /etc/sysconfig/network-scripts/ifcfg-eth0-range0 Add the following : DEVICE=eth0-rang

  • Routers and routing protocol theory 2010-04-08

    Routers and routing protocol theory This paper explains the TCP / IP network, the router's basic working principle of the IP router several major functions, given the static and dynamic routing protocols routing protocols, and internal gateway protoc

  • rails3 Routing Notes 2010-04-09

    rails3 routing drastic changes took place, is living in the project name Redmine:: Application.routes.draw do | map | rest routes eg. resources: trackers # Simple route: match '/ projects # edit' => 'projects # settings' # Post method of routing: pos

  • Rails way --->< The Rails Way> extract (3) routing 2010-05-27

    1. Routing system is a powerful way to send complex, it accepts URL, proper addressing, routing rules can also be used as a template generated URL string. (Accept the URL belongs to the basic operations, building URL count advanced to take advantage

  • WPF in understanding the events and order routing 2010-06-09

    Routing event here (1) vs designer, such as in the window add a button named MyButton, double-click it, then It's xaml declaration <Button Name="myButton" Click="myButton_Click"> Click Me </ Button> will specify the event h

  • ubuntu configure WPA/WPA2 wireless routing 2010-06-12

    As the linux kernel to support the WPA encryption is not very good, all the way to use common command line can not connect WPA2 types of routing. First check if installed wpasupplicant, ubuntu10.04 already installed. Need to use the command generates

  • Learning Rails routing settings (URI mapping) 2010-06-12

    URL mapping rules, in config / routes.rb file. This is a ruby class, not the configuration file. Set default home page of the map, example: map.root: controller => "home" This means that the site's home page of the controller for the home, ac

  • WINDOWS system set up under the dual card route this paper relates to the static routing 2010-06-17

    WINDOWS system set up under the dual card route this mainly related to static routing. 2, WINDOWS systems set up routing Manually set the route under the WINDOWS main character in the DOS command under the system (in the run input box you can type th

  • Rails Routing learning settings (URI mapping) 2010-06-12

    URL mapping rules, in config / routes.rb file. This is a ruby class, not the configuration file. Set default home page of the map, example: map.root: controller => "home" This means that the site's home page of the controller for the home, ac

  • rails routing settings 2010-07-14

    First, the routing rules A routing file config / routes.rb file a request to establish an external connection with the application 2 route set view routing applications defined in the RoutSet object, the object stored in ActionController:: Routing mo

  • Depth analysis of the configuration of static routing and related commands 2010-07-21

    Steps to configure static route is still very simple. In addition to the router because the router Router2 Router3 connected, the no longer connected with the other routers, so it can give a default route to configure a static route instead of the ab

  • IP protocol Xiangjie two: in-depth understanding of IP routing process 2010-07-21

    IP routing, Cisco network engineers need to understand a basic knowledge. In fact, IP routing is not as complicated as you think. The author in this article, through a case, to help our in-depth understanding of IP routing in the selection process. H

  • Routing, switch, hub, how different 2010-08-05

    Simple explanation: Routing: that is to share Internet access device, with dial-up function and the role of the switch. Switch: with the same hub that is the role of the hub, that is, together with the LAN computer. But the difference is that each sw

  • linux routing configuration command 2010-08-18

    Understand the network configuration command is generally necessary technology and technical personnel, after a period of research and learning, summarizes some commonly used commands and examples for future reference. Tradition of 1 - 3 points, ip r