2012-05-03 01:26:26 -04:00
|
|
|
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
|
2012-05-03 01:42:45 -04:00
|
|
|
@link = Link.get_and_count(params[:id])
|
2012-05-03 01:26:26 -04:00
|
|
|
|
2012-05-03 02:33:46 -04:00
|
|
|
#if it's not released, need to error
|
2012-05-03 01:26:26 -04:00
|
|
|
|
|
|
|
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 }
|
2012-05-03 01:26:26 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|