Sha256: c508151ccd40e45a6a5b035f023c79d4b97d85a19d4f724df48a650d9857526f

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

# encoding: UTF-8

# Copyright 2011 innoQ Deutschland GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

class RdfController < ApplicationController
  skip_before_filter :set_locale

  def show
    scope = if params[:published] == "0"
      Iqvoc::Concept.base_class.unpublished
    else
      Iqvoc::Concept.base_class.published
    end
    if @concept = scope.by_origin(params[:id]).with_associations.last
      respond_to do |format|
        format.html do
          redirect_to concept_url(:id => @concept.origin, :published => params[:published])
        end
        format.any do
          authorize! :read, @concept
          render "concepts/show"
        end
      end
    else
      raise ActiveRecord::RecordNotFound.new("Concept '#{params[:id]}' not found.")
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iqvoc-4.1.0 app/controllers/rdf_controller.rb