From 289857af429678e45da70980e86533c335254229 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Wed, 28 Nov 2007 23:00:24 +0000 Subject: [PATCH] ActionItem21: checkpoint --- app/controllers/my_profile/cms/text_html.rb | 4 +++- app/models/article.rb | 2 +- app/views/cms/new.rhtml | 8 +++++++- app/views/cms/text_html_new.rhtml | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/controllers/my_profile/cms/text_html.rb b/app/controllers/my_profile/cms/text_html.rb index a96a105..0321d87 100644 --- a/app/controllers/my_profile/cms/text_html.rb +++ b/app/controllers/my_profile/cms/text_html.rb @@ -2,7 +2,9 @@ class CmsController def text_html_new @article = Article.new(params[:article]) - @article.parent = profile.articles.find(params[:parent_id]) + if params[:parent_id] + @article.parent = profile.articles.find(params[:parent_id]) + end @article.profile = profile if request.post? if @article.save diff --git a/app/models/article.rb b/app/models/article.rb index dfd4653..84fa5d7 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -36,7 +36,7 @@ class Article < ActiveRecord::Base end def mime_type_description - _('Text document') + _('HTML Text document') end def title diff --git a/app/views/cms/new.rhtml b/app/views/cms/new.rhtml index f5ed00b..7d7445f 100644 --- a/app/views/cms/new.rhtml +++ b/app/views/cms/new.rhtml @@ -1,3 +1,9 @@ +

+ <%= _('Choose the type of article:') %> +

+ + diff --git a/app/views/cms/text_html_new.rhtml b/app/views/cms/text_html_new.rhtml index 6203abf..8aab311 100644 --- a/app/views/cms/text_html_new.rhtml +++ b/app/views/cms/text_html_new.rhtml @@ -2,7 +2,7 @@ <% labelled_form_for 'article', @article do |f| %> - <%= hidden_field_tag 'parent_id', params[:parent_id] %> + <%= hidden_field_tag('parent_id', params[:parent_id]) if params[:parent_id] %> <%= f.text_field 'name' %> -- libgit2 0.21.2