To use this gem follow these simple steps
1. Include "gem remotipart" in your Gemfile
2. Bundle install
3. type this in your console: rails generate remotipart
4. Include jquery-1.4.2-min.js, rails.js, jquery.form.js and jquery.remotipart.js as your javascript files
5. Suppose you are using this in you new.html.erb file, then do this
<%= form_for @product, :html => { :multipart => true }, :remote => true do |f| %>
<%= f.label :file_upload %>
<%= f.file_field :file_upload %>
<%= f.file_field :file_upload %>
<%= f.submit %>
<% end %>6. In your create controller include: format.js {} instead of format.html{}
7. In create.js.erb file :
<%= remotipart_response do %>
//Write your javascript code here.
<% end %>
If you have any confusions go to https://github.com/formasfunction/remotipart. This site really helped me a lot.
Glad you found my Remotipart gem useful and good luck learning Rails.
ReplyDeleteI can't seem to get it to work. I have rails 3 and followed the fixes and tried to build a test app based on the tutorial. It stalls out with the Completed 406 Not Acceptable. I would really like to use it but can't waste any more time debugging :(
ReplyDelete@formasfunction: Thank you for the gem.. it has really helped us.
ReplyDelete@rprambo: May be there is some error in your js file... also you need to include remotipart.js and jform.js in your file. I hope you did it!
It was very nice article and it is very useful to Ruby on Rails Online Course Hyderabad
ReplyDeletemalatya bayan
ReplyDeleteağrı bayan
adana bayan
kilis bayan
osmaniye bayan
siirt bayan
muş bayan
bartın bayan
sivas bayan
çorlu bayan
yeni perde modelleri
ReplyDeletesms onay
Mobil ödeme bozdurma
nft nasıl alınır
ANKARA EVDEN EVE NAKLİYAT
trafik sigortası
dedektör
web sitesi kurma
aşk kitapları
özel ambulans
ReplyDeletenft nasıl alınır
en son çıkan perde modelleri
lisans satın al
uc satın al
minecraft premium
yurtdışı kargo
en son çıkan perde modelleri