Rails nested resource - setting param: issue - ruby-on-rails

I have the following routes declared:
resources :accounts, param: :account_id do
resources :instructions, param: :instruction_id do
resources :messages, param: :message_id
end
end
So accounts, instructions, messages are the 3 models I have. This gives me the routes:
account_instruction_messages GET /accounts/:account_account_id/instructions/:instruction_instruction_id/messages(.:format) messages#index
POST /accounts/:account_account_id/instructions/:instruction_instruction_id/messages(.:format) messages#create
new_account_instruction_message GET /accounts/:account_account_id/instructions/:instruction_instruction_id/messages/new(.:format) messages#new
edit_account_instruction_message GET /accounts/:account_account_id/instructions/:instruction_instruction_id/messages/:message_id/edit(.:format) messages#edit
account_instruction_message GET /accounts/:account_account_id/instructions/:instruction_instruction_id/messages/:message_id(.:format) messages#show
PATCH /accounts/:account_account_id/instructions/:instruction_instruction_id/messages/:message_id(.:format) messages#update
PUT /accounts/:account_account_id/instructions/:instruction_instruction_id/messages/:message_id(.:format) messages#update
DELETE /accounts/:account_account_id/instructions/:instruction_instruction_id/messages/:message_id(.:format) messages#destroy
account_instructions GET /accounts/:account_account_id/instructions(.:format) instructions#index
POST /accounts/:account_account_id/instructions(.:format) instructions#create
new_account_instruction GET /accounts/:account_account_id/instructions/new(.:format) instructions#new
edit_account_instruction GET /accounts/:account_account_id/instructions/:instruction_id/edit(.:format) instructions#edit
account_instruction GET /accounts/:account_account_id/instructions/:instruction_id(.:format) instructions#show
PATCH /accounts/:account_account_id/instructions/:instruction_id(.:format) instructions#update
PUT /accounts/:account_account_id/instructions/:instruction_id(.:format) instructions#update
DELETE /accounts/:account_account_id/instructions/:instruction_id(.:format) instructions#destroy
That looks wrong to me, I was expecting
/accounts/:account_id/instructions/:instruction_id etc...?
Can someone advise what I am doing wrong?

you can do it in next way:
resources :accounts do
resources :instructions do
resources :messages, param: :message_id
end
end
this will make you next routes:
account_instruction_messages GET /accounts/:account_id/instructions/:instruction_id/messages(.:format) messages#index
POST /accounts/:account_id/instructions/:instruction_id/messages(.:format) messages#create
new_account_instruction_message GET /accounts/:account_id/instructions/:instruction_id/messages/new(.:format) messages#new
edit_account_instruction_message GET /accounts/:account_id/instructions/:instruction_id/messages/:message_id/edit(.:format) messages#edit
account_instruction_message GET /accounts/:account_id/instructions/:instruction_id/messages/:message_id(.:format) messages#show
PATCH /accounts/:account_id/instructions/:instruction_id/messages/:message_id(.:format) messages#update
PUT /accounts/:account_id/instructions/:instruction_id/messages/:message_id(.:format) messages#update
DELETE /accounts/:account_id/instructions/:instruction_id/messages/:message_id(.:format) messages#destroy
account_instructions GET /accounts/:account_id/instructions(.:format) instructions#index
POST /accounts/:account_id/instructions(.:format) instructions#create
new_account_instruction GET /accounts/:account_id/instructions/new(.:format) instructions#new
edit_account_instruction GET /accounts/:account_id/instructions/:id/edit(.:format) instructions#edit
account_instruction GET /accounts/:account_id/instructions/:id(.:format) instructions#show
PATCH /accounts/:account_id/instructions/:id(.:format) instructions#update
PUT /accounts/:account_id/instructions/:id(.:format) instructions#update
DELETE /accounts/:account_id/instructions/:id(.:format) instructions#destroy
accounts GET /accounts(.:format) accounts#index
POST /accounts(.:format) accounts#create
new_account GET /accounts/new(.:format) accounts#new
edit_account GET /accounts/:id/edit(.:format) accounts#edit
account GET /accounts/:id(.:format) accounts#show
PATCH /accounts/:id(.:format) accounts#update
PUT /accounts/:id(.:format) accounts#update
DELETE /accounts/:id(.:format) accounts#destroy
UPDATE
but if you need all same params, you can do:
resources :accounts, only: [] do
resources :instructions, only: [] do
resources :messages, param: :message_id
end
end
resources :accounts, param: :account_id
resources :instructions, param: :instruction_id
and this will return:
account_instruction_messages GET /accounts/:account_id/instructions/:instruction_id/messages(.:format) messages#index
POST /accounts/:account_id/instructions/:instruction_id/messages(.:format) messages#create
new_account_instruction_message GET /accounts/:account_id/instructions/:instruction_id/messages/new(.:format) messages#new
edit_account_instruction_message GET /accounts/:account_id/instructions/:instruction_id/messages/:message_id/edit(.:format) messages#edit
account_instruction_message GET /accounts/:account_id/instructions/:instruction_id/messages/:message_id(.:format) messages#show
PATCH /accounts/:account_id/instructions/:instruction_id/messages/:message_id(.:format) messages#update
PUT /accounts/:account_id/instructions/:instruction_id/messages/:message_id(.:format) messages#update
DELETE /accounts/:account_id/instructions/:instruction_id/messages/:message_id(.:format) messages#destroy
accounts GET /accounts(.:format) accounts#index
POST /accounts(.:format) accounts#create
new_account GET /accounts/new(.:format) accounts#new
edit_account GET /accounts/:accounts_id/edit(.:format) accounts#edit
account GET /accounts/:accounts_id(.:format) accounts#show
PATCH /accounts/:accounts_id(.:format) accounts#update
PUT /accounts/:accounts_id(.:format) accounts#update
DELETE /accounts/:accounts_id(.:format) accounts#destroy
....... and so on

Related

Ruby on Rails - routing to a new page

I would like to create a new route that leads to the url '../coins/:id/events/pending-events' however my new route is leading to '..coins/:coin_id/events/:event_id/pending-events' when I do this. What am I doing wrong here and how can I fix this?
routes.rb
resources :coins do
...
resources :events do
get 'pending-events', to: 'events#pending'
member do
put "like", to: "events#upvote"
put "dislike", to: "events#downvote"
end
end
...
end
event_controller.rb
...
def pending
#events = Event.where(coin_id: #coin.id).order("created_at DESC")
end
...
Just add on: :collection to your route e.g:
resources :coins do
...
resources :events do
get 'pending-events', to: 'events#pending', on: :collection
member do
put "like", to: "events#upvote"
put "dislike", to: "events#downvote"
end
end
...
end
More info: https://guides.rubyonrails.org/routing.html#adding-collection-routes
I suggest you do:
resources :coins do
resources :events do
collection do
get :pending
end
member do
put "like", to: "events#upvote"
put "dislike", to: "events#downvote"
end
end
end
Which will give you:
pending_coin_events GET /coins/:coin_id/events/pending(.:format) events#pending
like_coin_event PUT /coins/:coin_id/events/:id/like(.:format) events#upvote
dislike_coin_event PUT /coins/:coin_id/events/:id/dislike(.:format) events#downvote
coin_events GET /coins/:coin_id/events(.:format) events#index
POST /coins/:coin_id/events(.:format) events#create
new_coin_event GET /coins/:coin_id/events/new(.:format) events#new
edit_coin_event GET /coins/:coin_id/events/:id/edit(.:format) events#edit
coin_event GET /coins/:coin_id/events/:id(.:format) events#show
PATCH /coins/:coin_id/events/:id(.:format) events#update
PUT /coins/:coin_id/events/:id(.:format) events#update
DELETE /coins/:coin_id/events/:id(.:format) events#destroy
coins GET /coins(.:format) coins#index
POST /coins(.:format) coins#create
new_coin GET /coins/new(.:format) coins#new
edit_coin GET /coins/:id/edit(.:format) coins#edit
coin GET /coins/:id(.:format) coins#show
PATCH /coins/:id(.:format) coins#update
PUT /coins/:id(.:format) coins#update
DELETE /coins/:id(.:format) coins#destroy
No need to specify to: and pending_coin_events_path reads nicely.
Personally, I would do:
resources :coins do
resources :events do
collection do
get :pending
end
member do
put :upvote
put :downvote
end
end
end
Which will give you:
pending_coin_events GET /coins/:coin_id/events/pending(.:format) events#pending
upvote_coin_event PUT /coins/:coin_id/events/:id/upvote(.:format) events#upvote
downvote_coin_event PUT /coins/:coin_id/events/:id/downvote(.:format) events#downvote
coin_events GET /coins/:coin_id/events(.:format) events#index
POST /coins/:coin_id/events(.:format) events#create
new_coin_event GET /coins/:coin_id/events/new(.:format) events#new
edit_coin_event GET /coins/:coin_id/events/:id/edit(.:format) events#edit
coin_event GET /coins/:coin_id/events/:id(.:format) events#show
PATCH /coins/:coin_id/events/:id(.:format) events#update
PUT /coins/:coin_id/events/:id(.:format) events#update
DELETE /coins/:coin_id/events/:id(.:format) events#destroy
coins GET /coins(.:format) coins#index
POST /coins(.:format) coins#create
new_coin GET /coins/new(.:format) coins#new
edit_coin GET /coins/:id/edit(.:format) coins#edit
coin GET /coins/:id(.:format) coins#show
PATCH /coins/:id(.:format) coins#update
PUT /coins/:id(.:format) coins#update
DELETE /coins/:id(.:format) coins#destroy
I like that better because:
You're doing less typing
Your action and paths are parallel
Symbols are (IMO) prettier and subject to fewer typos
But, that's just me.

admin/login route is going post page

my routes.rb
get '/admin/login' => 'admin/sessions#new'
get '/admin/logout' => 'admin/sessions#destroy'
get '/admin' => 'admin/dashboard#index'
get 'blog' => 'blogs#index'
get ':id' => 'posts#show'
get 'posts/:id' => redirect('%{id}')
get 'blog/:id' => 'blogs#show'
get 'category/:id' => 'posts#index'
namespace :admin do
resources :sessions, only: [:new, :create, :destroy]
resources :login, only: [:index, :edit]
resources :categories
resources :admins, only: [:index, :edit, :update, :new, :create, :destroy]
resources :dashboard, only:[:index]
resources :settings, only:[:new, :create, :edit, :update]
resources :posts
resources :blogs
end
resources :home, only:[:index]
resources :posts, only:[:index, :show]
resources :blogs, only:[:index, :show]
when i try go to the /admin/login page it is seems like post page or something. but i can see the login form. just it is not admin page (i mean there is no my admin css or something it is seems like admin login form in my normal front end post page. and when i try login with my username and password it is giving this error:
ActionView::MissingTemplate in Admin::Posts#new
then im deleting this part from routes.rb
get 'blog' => 'blogs#index'
get ':id' => 'posts#show'
get 'posts/:id' => redirect('%{id}')
get 'blog/:id' => 'blogs#show'
get 'category/:id' => 'posts#index'
then i can go to the admin page. then im pasting this part again and still can use admin panel with no errors i dont understand.
can someone help? (sorry for my english)
here is the rake routes
Prefix Verb URI Pattern Controller#Action
root GET / home#index
admin_login GET /admin/login(.:format) admin/sessions#new
admin_logout GET /admin/logout(.:format) admin/sessions#destroy
admin GET /admin(.:format) admin/dashboard#index
blog GET /blog(.:format) blogs#index
GET /:id(.:format) posts#show
GET /posts/:id(.:format) redirect(301, %{id})
GET /blog/:id(.:format) blogs#show
GET /category/:id(.:format) posts#index
admin_sessions POST /admin/sessions(.:format) admin/sessions#create
new_admin_session GET /admin/sessions/new(.:format) admin/sessions#new
admin_session DELETE /admin/sessions/:id(.:format) admin/sessions#destroy
admin_login_index GET /admin/login(.:format) admin/login#index
edit_admin_login GET /admin/login/:id/edit(.:format) admin/login#edit
admin_categories GET /admin/categories(.:format) admin/categories#index
POST /admin/categories(.:format) admin/categories#create
new_admin_category GET /admin/categories/new(.:format) admin/categories#new
edit_admin_category GET /admin/categories/:id/edit(.:format) admin/categories#edit
admin_category GET /admin/categories/:id(.:format) admin/categories#show
PATCH /admin/categories/:id(.:format) admin/categories#update
PUT /admin/categories/:id(.:format) admin/categories#update
DELETE /admin/categories/:id(.:format) admin/categories#destroy
admin_admins GET /admin/admins(.:format) admin/admins#index
POST /admin/admins(.:format) admin/admins#create
new_admin_admin GET /admin/admins/new(.:format) admin/admins#new
edit_admin_admin GET /admin/admins/:id/edit(.:format) admin/admins#edit
admin_admin PATCH /admin/admins/:id(.:format) admin/admins#update
PUT /admin/admins/:id(.:format) admin/admins#update
DELETE /admin/admins/:id(.:format) admin/admins#destroy
admin_dashboard_index GET /admin/dashboard(.:format) admin/dashboard#index
admin_settings POST /admin/settings(.:format) admin/settings#create
new_admin_setting GET /admin/settings/new(.:format) admin/settings#new
edit_admin_setting GET /admin/settings/:id/edit(.:format) admin/settings#edit
admin_setting PATCH /admin/settings/:id(.:format) admin/settings#update
PUT /admin/settings/:id(.:format) admin/settings#update
admin_posts GET /admin/posts(.:format) admin/posts#index
POST /admin/posts(.:format) admin/posts#create
new_admin_post GET /admin/posts/new(.:format) admin/posts#new
edit_admin_post GET /admin/posts/:id/edit(.:format) admin/posts#edit
admin_post GET /admin/posts/:id(.:format) admin/posts#show
PATCH /admin/posts/:id(.:format) admin/posts#update
PUT /admin/posts/:id(.:format) admin/posts#update
DELETE /admin/posts/:id(.:format) admin/posts#destroy
admin_blogs GET /admin/blogs(.:format) admin/blogs#index
POST /admin/blogs(.:format) admin/blogs#create
new_admin_blog GET /admin/blogs/new(.:format) admin/blogs#new
edit_admin_blog GET /admin/blogs/:id/edit(.:format) admin/blogs#edit
admin_blog GET /admin/blogs/:id(.:format) admin/blogs#show
PATCH /admin/blogs/:id(.:format) admin/blogs#update
PUT /admin/blogs/:id(.:format) admin/blogs#update
DELETE /admin/blogs/:id(.:format) admin/blogs#destroy
home_index GET /home(.:format) home#index
posts GET /posts(.:format) posts#index
post GET /posts/:id(.:format) posts#show
blogs GET /blogs(.:format) blogs#index
GET /blogs/:id(.:format) blogs#show
Seems like the issue is on these two lines.
get ':id' => 'posts#show'
get 'posts/:id' => redirect('%{id}')
Try this
get 'posts/:id' => 'posts#show'

Administrate - Rails 4 | `add_route': Invalid route name, already in use: 'admin_root'

=> After deploying my rails app on Heroku
=> I cannot access to my admin at mysite.heroku.com/admin
--
I run heroku logs
The error : Invalid route name, already in use: 'admin_root'
/app/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/routing/route_set.rb:549:in `add_route': Invalid route name, already in use: 'admin_root' (ArgumentError)
And You may have defined two routes with the same name using the :as option
2016-10-24T13:43:56.930010+00:00 app[web.1]: You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:
--
This is my config/routes.rb :
Rails.application.routes.draw do
root 'pages#index'
get '/agence' => 'pages#agence'
get '/methode' => 'pages#methode'
get 'projets' => 'projet#index'
get 'projets/:slug' => 'projet#show', as: 'projet'
get '/article' => 'article#index'
get '/article/:slug' => 'article#show', as: 'articles'
get '/contact' => 'pages#contact'
get '/mentionslegales' => 'pages#mentionslegales'
namespace :admin do
resources :projets
resources :articles
resources :users
# get '/' => 'projets#index'
root to: "projets#index"
end
if defined?(DashboardManifest)
namespace :admin do
DashboardManifest::DASHBOARDS.each do |dashboard_resource|
resources dashboard_resource
end
root controller: DashboardManifest::ROOT_DASHBOARD, action: :index
end
end
--
Rake routes :
Prefix Verb URI Pattern Controller#Action
root GET / pages#index
agence GET /agence(.:format) pages#agence
methode GET /methode(.:format) pages#methode
projets GET /projets(.:format) projet#index
projet GET /projets/:slug(.:format) projet#show
article GET /article(.:format) article#index
articles GET /article/:slug(.:format) article#show
contact GET /contact(.:format) pages#contact
mentionslegales GET /mentionslegales(.:format) pages#mentionslegales
admin_projets GET /admin/projets(.:format) admin/projets#index
POST /admin/projets(.:format) admin/projets#create
new_admin_projet GET /admin/projets/new(.:format) admin/projets#new
edit_admin_projet GET /admin/projets/:id/edit(.:format) admin/projets#edit
admin_projet GET /admin/projets/:id(.:format) admin/projets#show
PATCH /admin/projets/:id(.:format) admin/projets#update
PUT /admin/projets/:id(.:format) admin/projets#update
DELETE /admin/projets/:id(.:format) admin/projets#destroy
admin_articles GET /admin/articles(.:format) admin/articles#index
POST /admin/articles(.:format) admin/articles#create
new_admin_article GET /admin/articles/new(.:format) admin/articles#new
edit_admin_article GET /admin/articles/:id/edit(.:format) admin/articles#edit
admin_article GET /admin/articles/:id(.:format) admin/articles#show
PATCH /admin/articles/:id(.:format) admin/articles#update
PUT /admin/articles/:id(.:format) admin/articles#update
DELETE /admin/articles/:id(.:format) admin/articles#destroy
admin_users GET /admin/users(.:format) admin/users#index
POST /admin/users(.:format) admin/users#create
new_admin_user GET /admin/users/new(.:format) admin/users#new
edit_admin_user GET /admin/users/:id/edit(.:format) admin/users#edit
admin_user GET /admin/users/:id(.:format) admin/users#show
PATCH /admin/users/:id(.:format) admin/users#update
PUT /admin/users/:id(.:format) admin/users#update
DELETE /admin/users/:id(.:format) admin/users#destroy
admin_root GET /admin(.:format) admin/projets#index
I don't understand this error and how to resolve it.
I already read all posts about this error but can't find the solution..
Finally the solution was to with draw theses lines from routes.rb :
if defined?(DashboardManifest)
namespace :admin do
DashboardManifest::DASHBOARDS.each do |dashboard_resource|
resources dashboard_resource
end
root controller: DashboardManifest::ROOT_DASHBOARD, action: :index
end
end

How to configure routes.rb for get access to localhost:3000/admin

I follow the tutorial of active_admin at this url: activeadmin
I tried to add it to a project that already exists followings this differents steps:
Add it to my Gemfile gem 'activeadmin', github: 'activeadmin'
Run the follow command because i already install devise rails g active_admin:install --skip-users
And rake db:migrate && rails server
My problem is that when i want to access to localhost:3000/admin i get this error Unknown Action AbstractController::ActionNotFound
Here is my routes.rb
Rails.application.routes.draw do
config = ActiveAdmin::Devise.config
config[:controllers][:sessions] = 'sessions'
config[:controllers][:registrations] = 'registrations'
config[:as] = 'admin'
devise_for :users, config
# Login / Logout routes
namespace :v1, path: '/' do
devise_scope :user do
post '/sessions', to: 'sessions#create'
post '/registrations', to: 'registrations#create'
delete '/sessions', to: 'sessions#destroy'
end
# User routes
get '/user', to: 'users#show'
patch '/user/update', to: 'users#update'
end
ActiveAdmin.routes(self)
end
I'm using rails 4.2.1 and ruby 2.2.2
UPDATE 09/06
rake routes
new_admin_user_session GET /admin/login(.:format) sessions#new
admin_user_session POST /admin/login(.:format) sessions#create
destroy_admin_user_session DELETE|GET /admin/logout(.:format) sessions#destroy
admin_user_password POST /admin/password(.:format) active_admin/devise/passwords#create
new_admin_user_password GET /admin/password/new(.:format) active_admin/devise/passwords#new
edit_admin_user_password GET /admin/password/edit(.:format) active_admin/devise/passwords#edit
PATCH /admin/password(.:format) active_admin/devise/passwords#update
PUT /admin/password(.:format) active_admin/devise/passwords#update
cancel_admin_user_registration GET /admin/cancel(.:format) registrations#cancel
admin_user_registration POST /admin(.:format) registrations#create
new_admin_user_registration GET /admin/sign_up(.:format) registrations#new
edit_admin_user_registration GET /admin/edit(.:format) registrations#edit
PATCH /admin(.:format) registrations#update
PUT /admin(.:format) registrations#update
DELETE /admin(.:format) registrations#destroy
v1_sessions POST /sessions(.:format) v1/sessions#create
v1_registrations POST /registrations(.:format) v1/registrations#create
DELETE /sessions(.:format) v1/sessions#destroy
v1_user GET /user(.:format) v1/users#show
v1_user_update PATCH /user/update(.:format) v1/users#update
admin_root GET /admin(.:format) admin/dashboard#index
admin_dashboard GET /admin/dashboard(.:format) admin/dashboard#index
batch_action_admin_admin_users POST /admin/admin_users/batch_action(.:format) admin/admin_users#batch_action
admin_admin_users GET /admin/admin_users(.:format) admin/admin_users#index
POST /admin/admin_users(.:format) admin/admin_users#create
new_admin_admin_user GET /admin/admin_users/new(.:format) admin/admin_users#new
edit_admin_admin_user GET /admin/admin_users/:id/edit(.:format) admin/admin_users#edit
admin_admin_user GET /admin/admin_users/:id(.:format) admin/admin_users#show
PATCH /admin/admin_users/:id(.:format) admin/admin_users#update
PUT /admin/admin_users/:id(.:format) admin/admin_users#update
DELETE /admin/admin_users/:id(.:format) admin/admin_users#destroy
admin_comments GET /admin/comments(.:format) admin/comments#index
POST /admin/comments(.:format) admin/comments#create
admin_comment GET /admin/comments/:id(.:format) admin/comments#show
and the log
F, [2015-06-09T10:45:02.609120 #2451] FATAL -- :
AbstractController::ActionNotFound (AbstractController::ActionNotFound):
/home/snoobie/.rvm/gems/ruby-2.2.2/bundler/gems/activeadmin-0b4b22871fd3/lib/active_admin/base_controller.rb:29:in `only_render_implemented_actions'
I hope someone can explain me what i'm doing wrong.
Thank you !
I solved it by using rails_admin, more easly to agregate to the project. If someone need more informations about the process to add rails_admin in rails project. Please let a comment and i will explain it in details.

Restful url not picking up id

I am having troubles with routes. I have defined routes like this:
resource :demo
resource :subjects
resource :pages
resource :sections
when i do
rake routes
it doesn't show right urls. it shows something like
Prefix Verb URI Pattern Controller#Action
root GET / demo#index
demo POST /demo(.:format) demos#create
new_demo GET /demo/new(.:format) demos#new
edit_demo GET /demo/edit(.:format) demos#edit
GET /demo(.:format) demos#show
PATCH /demo(.:format) demos#update
PUT /demo(.:format) demos#update
DELETE /demo(.:format) demos#destroy
subjects POST /subjects(.:format) subjects#create
new_subjects GET /subjects/new(.:format) subjects#new
edit_subjects GET /subjects/edit(.:format) subjects#edit
GET /subjects(.:format) subjects#show
PATCH /subjects(.:format) subjects#update
PUT /subjects(.:format) subjects#update
DELETE /subjects(.:format) subjects#destroy
pages POST /pages(.:format) pages#create
new_pages GET /pages/new(.:format) pages#new
edit_pages GET /pages/edit(.:format) pages#edit
GET /pages(.:format) pages#show
PATCH /pages(.:format) pages#update
PUT /pages(.:format) pages#update
DELETE /pages(.:format) pages#destroy
sections POST /sections(.:format) sections#create
new_sections GET /sections/new(.:format) sections#new
edit_sections GET /sections/edit(.:format) sections#edit
GET /sections(.:format) sections#show
PATCH /sections(.:format) sections#update
PUT /sections(.:format) sections#update
DELETE /sections(.:format) sections#destroy
GET /:controller(/:action(/:id(.:format))) :controller#:action
none of the urls has :id in them. what i might be doing wrong? It still sends id to controller but i am having hard time calling index and show methods as both of them are mapped to -----#show
This is because you are using singular resource, e.g. resource :foo. When you use singular resource, you don't get the :id. In order to get the :id in the parameter, you should change the resources declarations to plural resources:
resources :demoes
resources :subjects
resources :pages
resources :sections

Resources