diff options
| author | hukl <contact@smyck.org> | 2009-02-26 14:16:57 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-02-26 14:16:57 +0100 |
| commit | e04151525fa6963f2e55444a156fd47f24423e51 (patch) | |
| tree | 5e1fb5138837cc7f80649bcfaff87bd1a06f746c /app | |
| parent | 3190145bf0ebca1bdeff036c60ce6280c9d24c70 (diff) | |
the locale stuff as well as the cloning should work now entirely as expected although the cloning itself isn't really a beauty
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/nodes_controller.rb | 2 | ||||
| -rw-r--r-- | app/models/page.rb | 7 | ||||
| -rw-r--r-- | app/views/nodes/edit.html.erb | 5 |
3 files changed, 3 insertions, 11 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index e698ebc..9ba91f6 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb | |||
| @@ -42,7 +42,7 @@ class NodesController < ApplicationController | |||
| 42 | end | 42 | end |
| 43 | 43 | ||
| 44 | def edit | 44 | def edit |
| 45 | 45 | @draft = @node.find_or_create_draft( current_user ) | |
| 46 | end | 46 | end |
| 47 | 47 | ||
| 48 | def update | 48 | def update |
diff --git a/app/models/page.rb b/app/models/page.rb index ea481a6..aba974a 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -38,12 +38,5 @@ class Page < ActiveRecord::Base | |||
| 38 | :order => "#{options[:order_by]} #{options[:order_direction]}") | 38 | :order => "#{options[:order_by]} #{options[:order_direction]}") |
| 39 | end | 39 | end |
| 40 | 40 | ||
| 41 | def self.with_locale l, &block | ||
| 42 | old_locale = self.locale | ||
| 43 | self.locale = l | ||
| 44 | yield | ||
| 45 | self.locale = old_locale | ||
| 46 | end | ||
| 47 | |||
| 48 | # Instance Methods | 41 | # Instance Methods |
| 49 | end \ No newline at end of file | 42 | end \ No newline at end of file |
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index e2c0965..64d4756 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -12,8 +12,7 @@ | |||
| 12 | <% form_for(@node) do |f| %> | 12 | <% form_for(@node) do |f| %> |
| 13 | <%= f.error_messages %> | 13 | <%= f.error_messages %> |
| 14 | 14 | ||
| 15 | <% draft = @node.find_or_create_draft( current_user ) %> | 15 | <% fields_for @draft do |d| %> |
| 16 | <% fields_for draft do |d| %> | ||
| 17 | <p></p> | 16 | <p></p> |
| 18 | <p> | 17 | <p> |
| 19 | <%= d.label :title %><br /> | 18 | <%= d.label :title %><br /> |
| @@ -21,7 +20,7 @@ | |||
| 21 | </p> | 20 | </p> |
| 22 | <p> | 21 | <p> |
| 23 | <%= d.label 'Tags, comma sperated' %><br /> | 22 | <%= d.label 'Tags, comma sperated' %><br /> |
| 24 | <%= text_field_tag :tag_list, draft.tag_list.join(", ") %> | 23 | <%= text_field_tag :tag_list, @draft.tag_list.join(", ") %> |
| 25 | </p> | 24 | </p> |
| 26 | <p> | 25 | <p> |
| 27 | <%= d.label :abstract %><br /> | 26 | <%= d.label :abstract %><br /> |
