Class: Artk::ResourcesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/artk/resources_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
8
9
10
11
# File 'app/controllers/artk/resources_controller.rb', line 4

def index
  @results = return_resource_results.collect { |fa| fa.pid_and_title }
  respond_to do |format|
    format.html { render :layout => false, :text => @results.to_json }
    format.json { render :layout => false, :text => @results.to_json }
    format.js   { render :layout => false, :text => @results.to_json }
  end
end

#showObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/artk/resources_controller.rb', line 13

def show
  @resource = Resource.find_by_ead_id(params[:id])
  if @resource.nil?
    redirect_to :status => 404 
  else
    respond_to do |format|
      format.html { render :layout => false, :text => @resource.to_json }
      format.json { render :layout => false, :text => @resource.to_json }
      format.js   { render :layout => false, :text => @resource.to_json }
    end
  end

end