Skip to content

Commit

Permalink
Merge branch 'escapeurl'
Browse files Browse the repository at this point in the history
  • Loading branch information
patcito committed Jan 14, 2010
2 parents e78e293 + 013eb63 commit d93fb3e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions app/helpers/questions_helper.rb
Expand Up @@ -2,7 +2,7 @@ module QuestionsHelper
def microblogging_message(question)
message = "#{h(question.title)}"
message += " "
message += question_path(current_languages, question, :only_path =>false)
message += without_language_question_path(question, :only_path =>false)
message
end

Expand All @@ -14,8 +14,8 @@ def share_url(question, service)
when :identica
url = "http://identi.ca/notice/new?status_textarea=#{microblogging_message(question)}"
when :facebook
url = "http://www.facebook.com/sharer.php?u=#{question_path(current_languages, question, :only_path =>false)}&t=TEXTO"
url = "http://www.facebook.com/sharer.php?u=#{microblogging_message(question)}&t=TEXTO"
end
URI.escape(url)
url
end
end
36 changes: 18 additions & 18 deletions config/routes.rb
Expand Up @@ -18,26 +18,26 @@
map.resources :adbards
map.resources :badges

map.resources :questions, :path_prefix => '/:language',
:collection => {:tags => :get,
:unanswered => :get},
:member => {:solve => :get,
:unsolve => :get,
:flag => :get,
:favorite => :any,
:unfavorite => :any,
:watch => :any,
:unwatch => :any,
:move => :get,
:move_to => :put} do |questions|
questions.resources :answers, :member => {:flag => :get, :history => :get, :rollback => :put}
end

map.resources :questions, :collection => {:tags => :get,
:unanswered => :get} do |questions|
questions.resources :answers
def build_questions_routes(router, options)
router.with_options(options) do |route|
route.resources :questions, :collection => {:tags => :get,
:unanswered => :get},
:member => {:solve => :get,
:unsolve => :get,
:flag => :get,
:favorite => :any,
:unfavorite => :any,
:watch => :any,
:unwatch => :any,
:move => :get,
:move_to => :put} do |questions|
questions.resources :answers, :member => {:flag => :get, :history => :get, :rollback => :put}
end
end
end

build_questions_routes(map, :path_prefix => '/:language')
build_questions_routes(map, :name_prefix => "without_language_")

map.resources :groups, :member => {:accept => :get,
:close => :get,
Expand Down

0 comments on commit d93fb3e

Please sign in to comment.