From 51e91975cbfb81de40f2b8dd0ddada84b0c93ae6 Mon Sep 17 00:00:00 2001 From: hukl Date: Sun, 22 Feb 2009 13:23:38 +0100 Subject: created route for home page, removed rails index.html --- app/models/node.rb | 2 +- app/views/content/render_page.html.erb | 10 -- app/views/layouts/application.html.erb | 26 +--- config/routes.rb | 7 + lib/tasks/development_init.rake | 14 ++ public/index.html | 274 --------------------------------- 6 files changed, 24 insertions(+), 309 deletions(-) delete mode 100644 public/index.html diff --git a/app/models/node.rb b/app/models/node.rb index a6e3867..c99143f 100644 --- a/app/models/node.rb +++ b/app/models/node.rb @@ -24,7 +24,7 @@ class Node < ActiveRecord::Base unless revision.class == Fixnum raise ArgumentError, "revision must be a Fixnum" end - + node = Node.find_by_unique_name(path) if node diff --git a/app/views/content/render_page.html.erb b/app/views/content/render_page.html.erb index f499c9c..ca35403 100644 --- a/app/views/content/render_page.html.erb +++ b/app/views/content/render_page.html.erb @@ -1,14 +1,4 @@ -
-

Precontent

-

- Rhabarber, brable, bra..., bla, bla... (fasel) -

-
-
-
-
-

<%= @page.title %>

<%= date_for_page @page %>, <%= @page.user.try(:login) %>


diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6886a5f..828f5b2 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -24,12 +24,6 @@
- -
-

Topics

diff --git a/config/routes.rb b/config/routes.rb index ff9a13b..2fd3705 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,11 @@ ActionController::Routing::Routes.draw do |map| + map.root( + :locale => 'de', + :controller => 'content', + :action => 'render_page', + :page_path => ['home'] + ) + map.filter :locale map.resources :pages diff --git a/lib/tasks/development_init.rake b/lib/tasks/development_init.rake index 886474b..cdfe9e9 100644 --- a/lib/tasks/development_init.rake +++ b/lib/tasks/development_init.rake @@ -39,4 +39,18 @@ namespace :cccms do i = UpdateImporter.new("#{RAILS_ROOT}/db/updates") i.import_xml end + + desc "Create Home Page" + task :create_home_page => :environment do |t| + n = Node.create :slug => 'home' + n.move_to_child_of Node.root + + d = n.draft + d.title = "Startseite" + d.abstract = "Wilkommen auf der Seite des CCC" + d.body = "Hier gibts content" + d.save + + n.publish_draft! + end end \ No newline at end of file diff --git a/public/index.html b/public/index.html deleted file mode 100644 index e84c359..0000000 --- a/public/index.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - Ruby on Rails: Welcome aboard - - - - - - -
- - -
- - - - -
-

Getting started

-

Here’s how to get rolling:

- -
    -
  1. -

    Use script/generate to create your models and controllers

    -

    To see all available options, run it without parameters.

    -
  2. - -
  3. -

    Set up a default route and remove or rename this file

    -

    Routes are set up in config/routes.rb.

    -
  4. - -
  5. -

    Create your database

    -

    Run rake db:migrate to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    -
  6. -
-
-
- - -
- - \ No newline at end of file -- cgit v1.3