Skip to content

Instantly share code, notes, and snippets.

@dlikhten
Created October 1, 2012 01:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlikhten/3808895 to your computer and use it in GitHub Desktop.
Save dlikhten/3808895 to your computer and use it in GitHub Desktop.
Rails won't read this one
This POST is ignored by rails completely, It just posts and authenticity is rejected, the "_method" is rejected so rails can't rout properly, etc.
Rails 3.2.8
Thin
Both local & heroku have this problem.
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="utf8"
✓
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="authenticity_token"
vKTArYrkoYiEgGtjVX3oJ9pEJpeqLqXB3veo+eFyuvc=
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="dialog_id"
welcome
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="user[avatar_file_kind]"
pre_2
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="user[avatar]"; filename=""
Content-Type: application/octet-stream
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="authenticity_token"
vKTArYrkoYiEgGtjVX3oJ9pEJpeqLqXB3veo+eFyuvc=
Log:
Started POST "/users/110001" for 127.0.0.1 at 2012-09-30 21:00:08 -0400
ActionController::RoutingError (No route matches [POST] "/users/110001"):
config/initializers/quiet_assets.rb:10:in `call_with_quiet_assets'
This POST is ignored by rails completely, It just posts and authenticity is rejected, the "_method" is rejected so rails can't rout properly, etc.
Rails 3.2.8
Thin
Both local & heroku have this problem.
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="utf8"
✓
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="authenticity_token"
vKTArYrkoYiEgGtjVX3oJ9pEJpeqLqXB3veo+eFyuvc=
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="dialog_id"
welcome
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="user[avatar_file_kind]"
pre_2
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="user[avatar]"; filename=""
Content-Type: application/octet-stream
------WebKitFormBoundarymOqg5iqQUYsBo0SI
Content-Disposition: form-data; name="authenticity_token"
vKTArYrkoYiEgGtjVX3oJ9pEJpeqLqXB3veo+eFyuvc=
Log:
Started POST "/users/110001" for 127.0.0.1 at 2012-09-30 21:00:08 -0400
ActionController::RoutingError (No route matches [POST] "/users/110001"):
config/initializers/quiet_assets.rb:10:in `call_with_quiet_assets'
= simple_form_for @user, url: user_path(@user), method: :post, html: {'data-iframe-remote' => true} do |f|
%input(name="dialog_id" value="welcome" type="hidden")
%h4.heading.separation
.text_split.bottom
.primary.full_width
Come on in!
.secondary
%a.link.really.boring.close#x(href="#") ×
%p.text
Text
%p.text
Text
%h5.heading.section.sub_sub
A label
%p.text.caption
(You can always change it later.)
.text_spacing(style="vertical-align: middle")
%span(style="display: none")
= f.radio_button(:avatar_file_kind, "upload")
= f.radio_button(:avatar_file_kind, "pre_1")
= f.radio_button(:avatar_file_kind, "pre_2")
= f.radio_button(:avatar_file_kind, "pre_3")
%img#upload_avatar.click_to_check(src="#{image_path("photo_blank_avatar.png")}" data-unselected-src="#{image_path("photo_blank_avatar.png")}" data-selected-src="#{image_path("photo_blank_avatar_selected.png")}" data-select="#user_avatar_file_kind_upload" style="width: 75px; height: 75px;")
%span.spacing
or
%img.click_to_check(src="#{image_path("house_avatar1.png")}" data-unselected-src="#{image_path("house_avatar1.png")}" data-selected-src="#{image_path("house_avatar1_selected.png")}" data-select="#user_avatar_file_kind_pre_1" style="width: 75px; height: 75px;")
%img.click_to_check(src="#{image_path("house_avatar2.png")}" data-unselected-src="#{image_path("house_avatar2.png")}" data-selected-src="#{image_path("house_avatar2_selected.png")}" data-select="#user_avatar_file_kind_pre_2" style="width: 75px; height: 75px;")
%img.click_to_check(src="#{image_path("house_avatar3.png")}" data-unselected-src="#{image_path("house_avatar3.png")}" data-selected-src="#{image_path("house_avatar3_selected.png")}" data-select="#user_avatar_file_kind_pre_3" style="width: 75px; height: 75px;")
.text_spacing
- if f.error(:avatar).present?
%label.error_color.text Avatar #{f.error(:avatar)}
= f.file_field :avatar
.buttons.heading_spacing
%button.button.small(type="submit") Continue
// uses jquery.form (http://www.malsup.com/jquery/form/)
$("form[data-iframe-remote=true]").ajaxForm({
iframe: true
,success: DS.applyAjaxForm.success
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment