metacodes#show routes
This commit is contained in:
parent
387c863222
commit
14bdc8546b
2 changed files with 17 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
class MetacodesController < ApplicationController
|
||||
before_action :require_admin, except: [:index]
|
||||
before_action :require_admin, except: [:index, :show]
|
||||
|
||||
# GET /metacodes
|
||||
# GET /metacodes.json
|
||||
|
@ -18,6 +18,18 @@ class MetacodesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# GET /metacodes/1.json
|
||||
# GET /metacodes/Action.json
|
||||
# GET /metacodes/action.json
|
||||
def show
|
||||
@metacode = Metacode.where('DOWNCASE(name) = ?', downcase(params[:name])).first if params[:name]
|
||||
@metacode = Metacode.find(params[:id]) unless @metacode
|
||||
|
||||
respond_to do |format|
|
||||
format.json { render json: @metacode }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /metacodes/new
|
||||
# GET /metacodes/new.json
|
||||
def new
|
||||
|
|
|
@ -23,7 +23,10 @@ Metamaps::Application.routes.draw do
|
|||
resources :messages, only: [:show, :create, :update, :destroy]
|
||||
resources :mappings, except: [:index, :new, :edit]
|
||||
resources :metacode_sets, :except => [:show]
|
||||
resources :metacodes, :except => [:show, :destroy]
|
||||
|
||||
resources :metacodes, :except => [:destroy]
|
||||
get 'metacodes/:name', to: 'metacodes#show'
|
||||
|
||||
resources :synapses, except: [:index, :new, :edit]
|
||||
resources :topics, except: [:index, :new, :edit] do
|
||||
get :autocomplete_topic, :on => :collection
|
||||
|
|
Loading…
Reference in a new issue