From ea8c12c74c332f6b4c12f3e582baf3cbe901e87d Mon Sep 17 00:00:00 2001 From: hukl Date: Tue, 17 Feb 2009 21:56:05 +0100 Subject: modified edit form to work with translated attributes. there seems to be something bogus with form for - to be investigated --- app/views/nodes/edit.html.erb | 56 ++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 67e3c56..477db81 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb @@ -2,28 +2,36 @@

Editing page

-<% form_for(@node) do |f| %> - <%= f.error_messages %> - - <% fields_for @node.find_or_create_draft( current_user ) do |d| %> -

- <%= d.label :title %>
- <%= d.text_field :title %> -

-

- <%= d.label :abstract %>
- <%= d.text_area :abstract %> -

-

- <%= d.label :body %>
- <%= d.text_area :body %> -

- <% end %> - -

- <%= f.submit "Update" %> -

-<% end %> +<%= I18n.locale %> + +<%= @node.unique_name %> -<%= link_to 'Show', @page %> | -<%= link_to 'Back', pages_path %> +
+ <% form_for(@node) do |f| %> + <%= f.error_messages %> + + <% draft = @node.find_or_create_draft( current_user ) %> + <% fields_for draft do |d| %> +

+

+ <%= d.label :title %>
+ <%= d.text_field :title, :value => draft.title %> +

+

+ <%= d.label :abstract %>
+ <%= d.text_area :abstract, :value => draft.abstract %> +

+

+ <%= d.label :body %>
+ <%= d.text_area :body, :value => draft.body, :class => 'with_editor' %> +

+ <% end %> + +

+ <%= f.submit "Update" %> +

+ <% end %> + + <%= link_to 'Show', @node %> | + <%= link_to 'Back', nodes_path %> +
\ No newline at end of file -- cgit v1.3