rails 3.1 url encodes things, but 3.0 doesn't
Oleg
committed Sep 20, 2011
commit e59dcd905cdc33737cca6a3255713c666fbcc3f6
Showing 4
changed files with
6 additions
and 5 deletions
app/views/cms_admin/files/_index.html.erb
+3
-2
| @@ | @@ -8,9 +8,10 @@ |
| elsif @snippet && !@snippet.new_record? | |
| [:snippet_id, @snippet.id] | |
| end | |
| - | url_param = key.present?? { :file => { key => id} } : nil |
| + | url_param = key.present?? "?file[#{key}]=#{id}" : '' |
| %> | |
| - | <%= form_for :file, :url => cms_admin_site_files_path(@site, url_param), :html => {:multipart => true} do |form| %> |
| + | |
| + | <%= form_for :file, :url => cms_admin_site_files_path(@site) + url_param, :html => {:multipart => true} do |form| %> |
| <a id='uploader_button' href='#' class='big button'><%= t('.button') %></a> | |
| <%= form.file_field :file, :multiple => true %> | |
| <% end %> | |
test/functional/cms_admin/layouts_controller_test.rb
+1
-1
| @@ | @@ -34,7 +34,7 @@ class CmsAdmin::LayoutsControllerTest < ActionController::TestCase |
| assert assigns(:layout) | |
| assert_template :edit | |
| assert_select "form[action=/cms-admin/sites/#{layout.site.id}/layouts/#{layout.id}]" | |
| - | assert_select "form[action='/cms-admin/sites/#{layout.site.id}/files?file%5Blayout_id%5D=#{layout.id}']" |
| + | assert_select "form[action='/cms-admin/sites/#{layout.site.id}/files?file[layout_id]=#{layout.id}']" |
| end | |
| def test_get_edit_failure | |
test/functional/cms_admin/pages_controller_test.rb
+1
-1
| @@ | @@ -125,7 +125,7 @@ class CmsAdmin::PagesControllerTest < ActionController::TestCase |
| assert_template :edit | |
| assert_select "form[action=/cms-admin/sites/#{page.site.id}/pages/#{page.id}]" | |
| assert_select "select[data-url=/cms-admin/sites/#{page.site.id}/pages/#{page.id}/form_blocks]" | |
| - | assert_select "form[action='/cms-admin/sites/#{page.site.id}/files?file%5Bpage_id%5D=#{page.id}']" |
| + | assert_select "form[action='/cms-admin/sites/#{page.site.id}/files?file[page_id]=#{page.id}']" |
| end | |
| def test_get_edit_failure | |
test/functional/cms_admin/snippets_controller_test.rb
+1
-1
| @@ | @@ -51,7 +51,7 @@ class CmsAdmin::SnippetsControllerTest < ActionController::TestCase |
| assert assigns(:snippet) | |
| assert_template :edit | |
| assert_select "form[action=/cms-admin/sites/#{snippet.site.id}/snippets/#{snippet.id}]" | |
| - | assert_select "form[action='/cms-admin/sites/#{snippet.site.id}/files?file%5Bsnippet_id%5D=#{snippet.id}']" |
| + | assert_select "form[action='/cms-admin/sites/#{snippet.site.id}/files?file[snippet_id]=#{snippet.id}']" |
| end | |
| def test_get_edit_failure | |