Skip to content

Commit

Permalink
* Bumped to version 0.3.5
Browse files Browse the repository at this point in the history
* Enable detour_to with all url variants that url_for accept.
  • Loading branch information
donv committed Nov 22, 2012
1 parent a85f019 commit e857a74
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
*~
.idea
simple_workflow-*.gem
/log
15 changes: 2 additions & 13 deletions lib/simple_workflow/helper.rb
Expand Up @@ -11,19 +11,8 @@ def detour_to(title, options, html_options = nil)

def with_detour(options, back_options = {})
detour_options = {:detour => (params.merge(back_options)).reject { |k, v| [:detour, :return_from_detour].include? k.to_sym }}
if options.is_a? String
return options + (options =~ /\?/ ? '&' : '?') + detour_options[:detour].map{|k,v| "detour[#{k}]=#{v}"}.join('&')
else
detour_options.update(options)
if options[:layout] == false
if detour_options[:action] !~ /_no_layout$/
detour_options[:detour].update({:action => detour_options[:action] + '_no_layout'})
end
elsif params[:action] =~ /_no_layout$/
detour_options[:detour].update({:action => detour_options[:action][0..-11]})
end
detour_options
end
url = url_for(options) if options.respond_to? :to_param
return url + (url =~ /\?/ ? '&' : '?') + detour_options[:detour].map{|k,v| "detour[#{k}]=#{v}"}.join('&')
end

def image_detour_to(image_source, title, url_options, image_options = nil, link_options = nil)
Expand Down
2 changes: 1 addition & 1 deletion lib/simple_workflow/version.rb
@@ -1,3 +1,3 @@
module SimpleWorkflow
VERSION = '0.3.4'
VERSION = '0.3.5'
end

0 comments on commit e857a74

Please sign in to comment.