users_controller.rb revision a5f0722ba82c3264d655572b92cc4cda51525123
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Displays a user profile
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesclass UsersController < InheritedResources::Base
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes actions :show
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes respond_to :json, :xml
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes def show
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @content_type = :users
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes super do |format|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes format.html do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @versions = resource.ontology_versions.latest.limit(10).all
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @failed_versions = resource.ontology_versions.failed
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes @comments = resource.comments.latest.limit(10).all
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes format.json do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes render :json => resource.to_json(:only => [:name, :name])
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes format.xml do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes render :xml => resource.to_xml(:only => [:id, :name])
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesend
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes