Nicolae Claudius
13 years ago
16 changed files with 53 additions and 20 deletions
@ -1,8 +0,0 @@ |
|||||||
class HomeController < ApplicationController |
|
||||||
skip_before_filter :authenticate_user! |
|
||||||
layout proc{|controller| request.xhr? ? false : 'marketing'} |
|
||||||
|
|
||||||
def index |
|
||||||
redirect_to domains_path if user_signed_in? |
|
||||||
end |
|
||||||
end |
|
@ -0,0 +1,22 @@ |
|||||||
|
class PagesController < ApplicationController |
||||||
|
skip_before_filter :authenticate_user! |
||||||
|
layout proc{|controller| request.xhr? ? false : 'marketing'} |
||||||
|
|
||||||
|
rescue_from ActionView::MissingTemplate do |exception| |
||||||
|
if exception.message =~ %r{Missing template pages/} |
||||||
|
raise ActionController::RoutingError, "No such page: #{params[:id]}" |
||||||
|
else |
||||||
|
raise exception |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
def show |
||||||
|
# redirect_to domains_path if user_signed_in? # for home page only |
||||||
|
render :template => current_page |
||||||
|
end |
||||||
|
|
||||||
|
protected |
||||||
|
|
||||||
|
def current_page; "pages/#{clean_path}" end |
||||||
|
def clean_path; Pathname.new("/#{params[:id]}").cleanpath.to_s[1..-1] end |
||||||
|
end |
@ -0,0 +1,13 @@ |
|||||||
|
<script type="text/javascript"> |
||||||
|
|
||||||
|
var _gaq = _gaq || []; |
||||||
|
_gaq.push(['_setAccount', 'UA-26239372-1']); |
||||||
|
_gaq.push(['_trackPageview']); |
||||||
|
|
||||||
|
(function() { |
||||||
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
||||||
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
||||||
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
||||||
|
})(); |
||||||
|
|
||||||
|
</script> |
@ -1,5 +1,5 @@ |
|||||||
require 'spec_helper' |
require 'spec_helper' |
||||||
|
|
||||||
describe HomeController do |
describe PagesController do |
||||||
|
|
||||||
end |
end |
@ -1,15 +1,15 @@ |
|||||||
require 'spec_helper' |
require 'spec_helper' |
||||||
|
|
||||||
# Specs in this file have access to a helper object that includes |
# Specs in this file have access to a helper object that includes |
||||||
# the HomeHelper. For example: |
# the PagesHelper. For example: |
||||||
# |
# |
||||||
# describe HomeHelper do |
# describe PagesHelper do |
||||||
# describe "string concat" do |
# describe "string concat" do |
||||||
# it "concats two strings with spaces" do |
# it "concats two strings with spaces" do |
||||||
# helper.concat_strings("this","that").should == "this that" |
# helper.concat_strings("this","that").should == "this that" |
||||||
# end |
# end |
||||||
# end |
# end |
||||||
# end |
# end |
||||||
describe HomeHelper do |
describe PagesHelper do |
||||||
pending "add some examples to (or delete) #{__FILE__}" |
pending "add some examples to (or delete) #{__FILE__}" |
||||||
end |
end |
Loading…
Reference in new issue