WIA/app/controllers/links_controller.rb

29 lines
501 B
Ruby
Raw Normal View History

class LinksController < ApplicationController
def index
@links = Link.released
respond_to do |format|
format.html
format.json { render :json => @links }
end
end
def new
end
def create
end
def show
@link = Link.get_and_count(params[:id])
2012-05-03 02:33:46 -04:00
#if it's not released, need to error
respond_to do |format|
format.html { redirect_to @link.url }
format.json { render :json => @link }
2012-05-03 02:33:46 -04:00
format.xml { render :xml => @link }
end
end
end