28 lines
432 B
Ruby
28 lines
432 B
Ruby
|
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.goto(params[:id])
|
||
|
|
||
|
#update link count
|
||
|
|
||
|
respond_to do |format|
|
||
|
format.html { redirect_to @link.url }
|
||
|
format.json { render :json => @link }
|
||
|
end
|
||
|
end
|
||
|
end
|