cleanup
git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@16 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7master
parent
cdfbabf38b
commit
6b2883d260
|
@ -7,7 +7,6 @@ class PagesController < ApplicationController
|
|||
@page = Page.find_by_title 'HomePage'
|
||||
@page ||= Page.create :title => 'HomePage',
|
||||
:redcloth => 'Welcome to BarleySodas!'
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.rhtml
|
||||
format.xml { render :xml => @page.to_xml }
|
||||
|
@ -39,8 +38,9 @@ class PagesController < ApplicationController
|
|||
respond_to do |format|
|
||||
if @page.save
|
||||
flash[:notice] = 'Page was successfully created.'
|
||||
format.html { redirect_to page_url(@page) }
|
||||
format.xml { head :created, :location => page_url(@page) }
|
||||
format.html { redirect_to page_url({ :id => @page.title_for_url }) }
|
||||
format.xml { head :created,
|
||||
:location => page_url({ :id => @page.title_for_url }) }
|
||||
else
|
||||
format.html { render :action => "new" }
|
||||
format.xml { render :xml => @page.errors.to_xml }
|
||||
|
@ -54,7 +54,7 @@ class PagesController < ApplicationController
|
|||
respond_to do |format|
|
||||
if @page.update_attributes(params[:page])
|
||||
flash[:notice] = 'Page was successfully updated.'
|
||||
format.html { redirect_to page_url(@page) }
|
||||
format.html { redirect_to page_url({ :id => @page.title_for_url }) }
|
||||
format.xml { head :ok }
|
||||
else
|
||||
format.html { render :action => "edit" }
|
||||
|
|
Reference in New Issue