Add snippet support and unpack liquid plugin
This commit is contained in:
1 parent
8dcde174cf
commit
438c508ea1
79 files changed
+5708
-1
No files matched your search
@@ -1,4 +1,7 @@
|
||||
class Admin::LayoutsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
|
||||
# GET /layouts
|
||||
# GET /layouts.xml
|
||||
def index
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
class Admin::PagesController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
|
||||
# GET /pages
|
||||
# GET /pages.xml
|
||||
def index
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
class Admin::SnippetsController < ApplicationController
|
||||
|
||||
layout "admin"
|
||||
|
||||
# GET /snippets
|
||||
# GET /snippets.xml
|
||||
def index
|
||||
@snippets = Snippet.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.xml { render :xml => @snippets }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /snippets/1
|
||||
# GET /snippets/1.xml
|
||||
def show
|
||||
@snippet = Snippet.find(params[:id])
|
||||
|
||||
redirect_to "/#{@snippet.name}"
|
||||
end
|
||||
|
||||
# GET /snippets/new
|
||||
# GET /snippets/new.xml
|
||||
def new
|
||||
@snippet = Snippet.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render :xml => @snippets }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /snippets/1/edit
|
||||
def edit
|
||||
@snippet = Snippet.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /snippets
|
||||
# POST /snippets.xml
|
||||
def create
|
||||
@snippet = Snippet.new(params[:snippet])
|
||||
|
||||
respond_to do |format|
|
||||
if @snippet.save
|
||||
flash[:notice] = 'Snippet was successfully created.'
|
||||
format.html { redirect_to admin_snippets_url }
|
||||
format.xml { render :xml => @snippet, :status => :created, :location => @snippets }
|
||||
else
|
||||
format.html { render :action => "new" }
|
||||
format.xml { render :xml => @snippet.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /snippets/1
|
||||
# PUT /snippets/1.xml
|
||||
def update
|
||||
@snippet = Snippet.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @snippet.update_attributes(params[:snippet])
|
||||
flash[:notice] = 'Snippet was successfully updated.'
|
||||
format.html { redirect_to admin_snippets_url }
|
||||
format.xml { head :ok }
|
||||
else
|
||||
format.html { render :action => "edit" }
|
||||
format.xml { render :xml => @snippet.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /snippets/1
|
||||
# DELETE /snippets/1.xml
|
||||
def destroy
|
||||
@snippet = Snippet.find(params[:id])
|
||||
@snippet.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to admin_snippets_url }
|
||||
format.xml { head :ok }
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user