I have been trying to apply this solution to my application but im encountering some errors, im guessing some rails 3 incompatibilities, does anyone know of a rails 3 example of nested forms on the net?
This is so awesome. i've reluctantly been using will_paginate but knew it could be done much better with aRel. Thanks for the great cast. I'm switching today.
Wow, I was just recently looking for an alternative to will_paginate that was compatible with Mongoid. Thanks again for the just-in-time railscast, Ryan!
Yep, I second that Allen, being able to change the page parameter's name is actually a crucial capability to me that is missing. I need it again and again, so I don't think its so uncommon. But I doubt it is difficult to change Kaminari to support this.
The only problem I have with kaminari is that you cannot change the parameter used from :page. This means it isn't possible to have multiple paginations on a page. Though, this probably isn't a common problem.
I do like it much better than will_paginate though, because it allows its based on scopes, which means you don't get weird errors when trying to apply other scopes on a paginated object like you do will_paginate.
When point my browser to http://localhost:3000/auth/facebook it indeed
redirects me to facebook to login. But on callback, instead of being
redirected to my url, I receive this error http://pastie.org/1588879
A recent change in rails edge make will_paginate rails3 branch not work any more so I switched to kaminari today. It took only half an hour .. awesome plugin!
Yuval Tobias and others interested in multiple fileupload to s3 with progress bar: check out my fancyupload based S3 uploader: http://www.railstoolkit.com/posts/rails-amazon-s3-uploader-with-progress-bar-2010-update
You'll have *unencrypted* passwords in your logs! One more thing needs to be done, described here: http://asciicasts.com/episodes/224-controllers-in-rails-3
Carierwave isn't so new ... I used it first time something about year ago for storing files in MongoDB GridFS. And yes, carrierwave is really great and well documented.
how to define mimetypes right in case of dynamic generating js and css (not only html )
Started GET "/" for 192.168.1.4 at 2011-02-19 13:26:13 +0300
Processing by WelcomeController#carousel as HTML
Rendered welcome/carousel.mobile.erb within layouts/application (47.3ms)
Completed 200 OK in 54ms (Views: 52.9ms | ActiveRecord: 0.0ms)
Started GET "/netzke/touch.css" for 192.168.1.4 at 2011-02-19 13:26:14 +0300
Processing by NetzkeController#touch as CSS
Completed 406 Not Acceptable in 1ms
Started GET "/netzke/touch.js" for 192.168.1.4 at 2011-02-19 13:26:14 +0300
Processing by NetzkeController#touch as JS
Completed 406 Not Acceptable in 1ms
Maybe I've missed something, but is it normal to download all assets from remote storage (s3) just to determine file size? For example I have 100 videos on production and have just migrated to carrierwave. Files already on S3. So all my production instanced need to have local copies just to display `video.source.size`???
it is according to https://github.com/jnicklas/carrierwave/blob/c9b5cbbe03ba8aca3977/lib/carrierwave/uploader/proxy.rb#L56
This is a great tutorial, however I'm having trouble getting it to work on my app. It seems like the instructions indicate the application.manifest file will auto-generate when you run localhost/application.manifest, but it doesn't do that for me :(
The app is Rails 2.3.8, Ruby 1.8.7 so I can't use Bundler to install, is that the problem?
Due to the current lack of good, middle level books on Rails 3, learning Rails is very hard right now. I've scraped much information together from various sources. This cast had the added bonus of pulling everything I've learned together and giving a great beginning example of how it all works without a bunch of wasted words or code that just slow me down and confuse me. Thanks so much for this.
Since we're in 2011 and using Rails 3.0.4 I thought I'd contribute back this necessary change:
in application_helper.rb, the link_to_add_fields function no longer needs the "h" escape that Rails 2 needed, which surrounded the second argument to link_to_function.
Would MetaWhere work with CanCan's 3rd parameter of the can method? If so, that would be great, if not, is there any plan to make the two plugins compatible?
It makes sense to the comment document have an author which is a user, right? How would one go about that? Is is possible to have this "cyclic" reference? (User has many posts has many comments has one User)? How to do that?
Regarding the fix for the undefined method 'table' error, it didn't work at first but I realized that it was 'prawn/core' that needed to be required and not 'prawn/console' as stated above. Just in case someone else is facing this issue. --> using prawnto v0.99, rails 2.1.0 (which is why I have to use an older version of prawnto) :o(
Henrik is right. Ryan does have a way of posting videos on exactly what I need. I believe Ryan is out best evidence for the paranormal to date :). From the paintings, it looks like talent runs in the family!
I'm wondering what the cleanest way of adding custom validations to a Uploader is. Of corse you can add a validation to your AR model, but that feels kind of messy. In my use case I need to validate the content type (not only the file extension).
Hi
Thanks Ryan for another amazing cast!
I have been trying to apply this solution to my application but im encountering some errors, im guessing some rails 3 incompatibilities, does anyone know of a rails 3 example of nested forms on the net?
Thanks
This is so awesome. i've reluctantly been using will_paginate but knew it could be done much better with aRel. Thanks for the great cast. I'm switching today.
I am bored with will_paginate. So, I decided to use kaminari.
@user 858: You could try uploadify: http://www.uploadify.com/
Wow, I was just recently looking for an alternative to will_paginate that was compatible with Mongoid. Thanks again for the just-in-time railscast, Ryan!
Can you create custom paginated collections?
@Nico Ritsche
Great gem thanks!!
But i don't use S3, do you know any gem to multiple file upload in easy way?
Good paginate gem! I love you!
Yep, I second that Allen, being able to change the page parameter's name is actually a crucial capability to me that is missing. I need it again and again, so I don't think its so uncommon. But I doubt it is difficult to change Kaminari to support this.
The only problem I have with kaminari is that you cannot change the parameter used from :page. This means it isn't possible to have multiple paginations on a page. Though, this probably isn't a common problem.
I do like it much better than will_paginate though, because it allows its based on scopes, which means you don't get weird errors when trying to apply other scopes on a paginated object like you do will_paginate.
awesome!
I love your screencasts, thanks a lot !
Easy pagination, thanks to your sharing
When point my browser to http://localhost:3000/auth/facebook it indeed
redirects me to facebook to login. But on callback, instead of being
redirected to my url, I receive this error http://pastie.org/1588879
Please help :(
A recent change in rails edge make will_paginate rails3 branch not work any more so I switched to kaminari today. It took only half an hour .. awesome plugin!
Cool, very helpful topic. I like the trick:
var new_id = new Date().getTime();
finally we get good option for will_paginate!
Yuval Tobias and others interested in multiple fileupload to s3 with progress bar: check out my fancyupload based S3 uploader: http://www.railstoolkit.com/posts/rails-amazon-s3-uploader-with-progress-bar-2010-update
@50 - sorry, my mistake. It is set by default to hide this param.
You'll have *unencrypted* passwords in your logs! One more thing needs to be done, described here: http://asciicasts.com/episodes/224-controllers-in-rails-3
Carierwave isn't so new ... I used it first time something about year ago for storing files in MongoDB GridFS. And yes, carrierwave is really great and well documented.
"formatted_categories_path" has to be changed to "categorie_spath(:format => :js)"...
...and...
in you category_controller.rb you have to specifiy another format:
respond_to do |format|
format.html # index.html.erb
format.js # index.js.erb
end
I found a weird thing that sometimes when using the back and forward buttons, the javascript is actually displayed in the browser.
See: http://www.youtube.com/watch?v=kCKa2OzSqKE
Has anyone else noticed this? Any suggestions for a solution?
Can anyone help me understand why we created a sessions controller instead of putting the required actions in the users controller?
Great tutorial as always
Nice screencast, very useful :)
I have one problem, with making generator as a global generator.
Where i must put files ?
Version from Rails 2 "$HOME/.rails/generators" don`t work anymore.
how to define mimetypes right in case of dynamic generating js and css (not only html )
Started GET "/" for 192.168.1.4 at 2011-02-19 13:26:13 +0300
Processing by WelcomeController#carousel as HTML
Rendered welcome/carousel.mobile.erb within layouts/application (47.3ms)
Completed 200 OK in 54ms (Views: 52.9ms | ActiveRecord: 0.0ms)
Started GET "/netzke/touch.css" for 192.168.1.4 at 2011-02-19 13:26:14 +0300
Processing by NetzkeController#touch as CSS
Completed 406 Not Acceptable in 1ms
Started GET "/netzke/touch.js" for 192.168.1.4 at 2011-02-19 13:26:14 +0300
Processing by NetzkeController#touch as JS
Completed 406 Not Acceptable in 1ms
i got 406 error on other types!
Excellent screencast! It turned out to very useful for me.
Found one bug.
link_to_add_fields in helpers/application_helper.rb does not allow locals to be passed to render method. I changed it to following to make it working.
https://gist.github.com/834910
Found it from
http://stackoverflow.com/questions/4248970/rails-fields-for-render-partial-with-multiple-locals-producing-undefined-variable
How you unsubscribe of one Notification? I have a very annoying Notification and I really want to remove it, I've try with
$> ActiveSupport::LogSubscriber.flush_all!
$> ActiveSupport::Notifications.unsubscribe( ActiveSupport::LogSubscriber.flushable_loggers.first )
but nothing of this works.
The notifications seem to be of active_record, here is one of the infinity notification that I see
Got notification: #<ActiveSupport::Notifications::Event:0xba9bdd8 @name="sql.active_record ......
I don't know how the notification were activated but I can't disable them, please help
I have a similar question to user 884.
this is what i'm trying to do.
https://gist.github.com/833459
a comment has one author but can have multiple recipients.
Has anyone done a "Live Search" with metasearch? Been trying but just can't get it to work.
Very large data files 50MB
Thanks for the wonderfully presented railscast.
I am wanting to upload mp3 files to my server then add mp3 metadata and zip them up before sending them off to Amazon S3.
I am concerned about the upload time so I was going to use Nginx upload module.
Another option would be to use Carrier wave and then store the files at Amazon then retrieve them for the processing and return them separately.
I would appreciate some reflections even a suggestion where to post such a question.
Thanks again
Best wishes Russell
Maybe I've missed something, but is it normal to download all assets from remote storage (s3) just to determine file size? For example I have 100 videos on production and have just migrated to carrierwave. Files already on S3. So all my production instanced need to have local copies just to display `video.source.size`???
it is according to https://github.com/jnicklas/carrierwave/blob/c9b5cbbe03ba8aca3977/lib/carrierwave/uploader/proxy.rb#L56
High fives to you kind sir.
Being a supreme rails noob, and wanting to leanr more, I put together a sample app demonstrating carrierwave + nested forms here
github.com/galaxylord/carrierwave_nested
CarrierWave throws a "400 Bad Request" error when using remote_image_url with a value of
http://ecx.images-amazon.com/images/I/51YBrr%2B0tvL.jpg
I believe it has to do with the '%' in the image name.
Any ideas on how to get around this?
github signin = WIN!!!!
SO i think this is a simple question ...
how do i get the awesome nokogiri purple header / document return screen?
This is a great tutorial, however I'm having trouble getting it to work on my app. It seems like the instructions indicate the application.manifest file will auto-generate when you run localhost/application.manifest, but it doesn't do that for me :(
The app is Rails 2.3.8, Ruby 1.8.7 so I can't use Bundler to install, is that the problem?
Due to the current lack of good, middle level books on Rails 3, learning Rails is very hard right now. I've scraped much information together from various sources. This cast had the added bonus of pulling everything I've learned together and giving a great beginning example of how it all works without a bunch of wasted words or code that just slow me down and confuse me. Thanks so much for this.
I had been waiting for this kind of screencast for a long time. Thanks Ryan.
Thanks
Who has two thumbs and loves Ryanb.... This guy!
Thanks for another great Railscast! I also love your nifty-generators.
Since we're in 2011 and using Rails 3.0.4 I thought I'd contribute back this necessary change:
in application_helper.rb, the link_to_add_fields function no longer needs the "h" escape that Rails 2 needed, which surrounded the second argument to link_to_function.
link_to_function(name ("add_fields(this, \"{association}\", \"#{escape_javascript(fields)}\")"))
Would MetaWhere work with CanCan's 3rd parameter of the can method? If so, that would be great, if not, is there any plan to make the two plugins compatible?
Is there anyway to integrate Jcrop to show/use a certain part of the image for the the thumbnails .. like facebook
hey there, let me ask you something...
It makes sense to the comment document have an author which is a user, right? How would one go about that? Is is possible to have this "cyclic" reference? (User has many posts has many comments has one User)? How to do that?
And your dad is an awesome artist.
Regarding the fix for the undefined method 'table' error, it didn't work at first but I realized that it was 'prawn/core' that needed to be required and not 'prawn/console' as stated above. Just in case someone else is facing this issue. --> using prawnto v0.99, rails 2.1.0 (which is why I have to use an older version of prawnto) :o(
Henrik is right. Ryan does have a way of posting videos on exactly what I need. I believe Ryan is out best evidence for the paranormal to date :). From the paintings, it looks like talent runs in the family!
Trying to do controller spec for index action with the MetaSearch in the mix but keep bumping into error. Code and error here
https://gist.github.com/827616
I guess this is probably more rspec/mocha related but any hints how to do this correctly?
There seems to be a [BUG] with RMagick and ruby 1.9.2 when trying to resize... I finall found the solution here if you still want to use Rmagick...
However, I found it much easier to just replace RMagick with MiniMagick and everything works great. MiniMagick uses less system resources too.
I'm wondering what the cleanest way of adding custom validations to a Uploader is. Of corse you can add a validation to your AR model, but that feels kind of messy. In my use case I need to validate the content type (not only the file extension).
Any ideas how to do that?