Skip to content
Snippets Groups Projects
Commit 8e51e516 authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

merge branch subjects_controller into master

parents 93b87362 f6221ce4
No related branches found
No related tags found
No related merge requests found
class SubjectsController < ApplicationController
# GET /subjects
# GET /subjects.json
def index
@subjects = subject_repository.all
end
# GET /subjects/1
# GET /subjects/1.json
def show
@subject = subject_repository.find("##{params[:id]}")
end
private
def subject_repository
repository.for(:subject)
end
# Never trust parameters from the scary internet, only allow the white list through.
def subject_params
params[:subject_object]
end
end
<p id="notice"><%= notice %></p>
<h1>Listing Subject</h1>
<%for subject in @subjects%>
<%= render 'shared/application/object_vertical', object: subject %>
<%end%>
<h1><%= @subject.name %></h1>
...@@ -8,12 +8,14 @@ Rails.application.routes.draw do ...@@ -8,12 +8,14 @@ Rails.application.routes.draw do
namespace :management do namespace :management do
root 'welcome#index' root 'welcome#index'
# statistics resources :statistics do
get 'statistics/', to: 'statistics#index', as: 'index_statistics' collection do
get 'statistics/users/' => 'statistics#users', as: 'users_statistics' get :users
get 'statistics/collections' => 'statistics#collections', as: 'collections_statistics' get :collections
get 'statistics/accesses' => 'statistics#accesses', as: 'accesses_statistics' get :accesses
get 'statistics/downloads' => 'statistics#downloads', as: 'downloads_statistics' get :downloads
end
end
resources :users resources :users
resources :highlights resources :highlights
...@@ -21,14 +23,17 @@ Rails.application.routes.draw do ...@@ -21,14 +23,17 @@ Rails.application.routes.draw do
root 'welcome#index' root 'welcome#index'
resources :learning_objects resources :learning_objects do
post '/learning_objects/:id/like' => 'learning_objects#like', as: 'like_learning_object' member do
post :like
end
end
resources :institutions resources :institutions
resources :collections resources :collections
resources :subjects, only: [:index, :show]
get 'users/:id', to: 'users#show', as: 'users_show' get 'users/:id', to: 'users#show', as: 'users_show'
get '/faq' => 'welcome#faq' get '/faq' => 'welcome#faq'
get '/contact' => 'welcome#contact', as: 'contact' get '/contact' => 'welcome#contact', as: 'contact'
get '/complaint' => 'welcome#complaint', as: 'complaint' get '/complaint' => 'welcome#complaint', as: 'complaint'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment