Commit 289857af429678e45da70980e86533c335254229
1 parent
acbf97a0
Exists in
master
and in
29 other branches
ActionItem21: checkpoint
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@965 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
12 additions
and
4 deletions
Show diff stats
app/controllers/my_profile/cms/text_html.rb
@@ -2,7 +2,9 @@ class CmsController | @@ -2,7 +2,9 @@ class CmsController | ||
2 | 2 | ||
3 | def text_html_new | 3 | def text_html_new |
4 | @article = Article.new(params[:article]) | 4 | @article = Article.new(params[:article]) |
5 | - @article.parent = profile.articles.find(params[:parent_id]) | 5 | + if params[:parent_id] |
6 | + @article.parent = profile.articles.find(params[:parent_id]) | ||
7 | + end | ||
6 | @article.profile = profile | 8 | @article.profile = profile |
7 | if request.post? | 9 | if request.post? |
8 | if @article.save | 10 | if @article.save |
app/models/article.rb
app/views/cms/new.rhtml
app/views/cms/text_html_new.rhtml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | <% labelled_form_for 'article', @article do |f| %> | 3 | <% labelled_form_for 'article', @article do |f| %> |
4 | 4 | ||
5 | - <%= hidden_field_tag 'parent_id', params[:parent_id] %> | 5 | + <%= hidden_field_tag('parent_id', params[:parent_id]) if params[:parent_id] %> |
6 | 6 | ||
7 | <%= f.text_field 'name' %> | 7 | <%= f.text_field 'name' %> |
8 | 8 |