[Git][noosfero/noosfero][master] follow-articles: sets profile on url to avoid route no match

Larissa Reis gitlab at mg.gitlab.com
Thu May 19 19:20:30 BRT 2016


Larissa Reis pushed to branch master at Noosfero / noosfero


Commits:
1ae8dae3 by Larissa Reis at 2016-05-19T19:19:48-03:00
follow-articles: sets profile on url to avoid route no match

For profiles with own domain sometimes there is no profile set, so we
have to give a profile on url generation to avoid breakage here.

- - - - -


1 changed file:

- app/helpers/article_helper.rb


Changes:

=====================================
app/helpers/article_helper.rb
=====================================
--- a/app/helpers/article_helper.rb
+++ b/app/helpers/article_helper.rb
@@ -187,9 +187,9 @@ module ArticleHelper
   def following_button(page, user)
     if !user.blank? and user != page.author
       if page.is_followed_by? user
-        button :cancel, unfollow_button_text(page), {:controller => 'profile', :action => 'unfollow_article', :article_id => page.id, :profile => page.profile.identifier}
+        button :cancel, unfollow_button_text(page), {:controller => 'profile', :profile => page.profile.identifier, :action => 'unfollow_article', :article_id => page.id, :profile => page.profile.identifier}
       else
-        button :add, follow_button_text(page), {:controller => 'profile', :action => 'follow_article', :article_id => page.id, :profile => page.profile.identifier}
+        button :add, follow_button_text(page), {:controller => 'profile', :profile => page.profile.identifier, :action => 'follow_article', :article_id => page.id, :profile => page.profile.identifier}
       end
     end
   end



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/1ae8dae3d7310a49d0663cab6aa59f9d95a4a55e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160519/6c8dd2c8/attachment.html>


More information about the Noosfero-dev mailing list