RailsCasts Pro episodes are now free!

Learn more or hide this

Recent Comments

Avatar

I second /users/858's request for a multiple-files screencast. I've been working on a SWFUpload implementation with Paperclip and S3 for a few weeks now, without much success... I got bogged down with the JavaScripts for making a simple Gmail-like uploads.

Avatar

would be great to have a carrierwave + jcrop integration railscast, as per paperclip cropping episode

Avatar

I having an issue trying to get the (:thumb) part to work. I think it has to do with RMagick and ImageMagick because its that steps that breaks on me.

I've followed the steps exactly, the only thing i couldnt do with the steps is install ImageMagick. I followed these instructions http://www.imagemagick.org/script/install-source.php?ImageMagick=9s6tlikqbn5eb0u0spg5o38sa4#unix

The error I'm getting http://pastie.org/1564737

Avatar

Good information, but polymorphic paperclip with STI is working wonders for me already.

Avatar

Hey Ryan,

Thanks for a great railscast!

One problem I ran into (and I'm not sure if it's my fault, or Rails 3, or something else) is that none of this worked until I added a = to <% fields_for ...

Hopefully that helps others, but in any case, thanks for the great info!

Avatar

Really nice!
It looks more flexible than Paperclip, though I have some problems with conversion and cropping a picture.

Avatar

Awesome!

A couple of suggestions for future episodes:

1. Converting from Paperclip to CarrierWave
2. Uploading images with CarrierWave, ajax, & an upload status bar -- include how to do this with HTML5 drag&drop and I'll weep great tears of joy.

Avatar

@7: CarrierWave has built in support for MiniMagick, which does the same thing Paperclip does: shelling out to ImageMagick directly. I'd really recommend taking another look at RMagick though, it's far more stable these days, I've never had a problem with it.

@14 Juan: IIRC validates_size_of works with CarrierWave at least on ActiveRecord and Mongoid.

Avatar

The only bad thing I've found in CarrierWave is that it doesn't have some built-in validations, e.g upload size =>

http://stackoverflow.com/questions/4753066/validate-size-of-upload-using-carrierwave

Avatar

Apparently, both Phil and Ryan are artists in their respective domains. Keep on the good work, both of you!

Avatar

@Tim the reason for that is you need to specify the _url part before the symbol. So in your case, @user.avatar_url(:thumb).to_s would be correct.

Pleased to see a flexible uploading solution with as much polish as Paperclip.

Avatar

I'm using CarrierWave to process images and store them on S3. It's a great gem.

Avatar

Thanks for this screencast!

Please, do another wih multiple file uploads,like:
swfupload.org
uploadify.com
plupload.com

Avatar

Thanks for this cast !

What textmate shortcut did you use to autocomplete "field"?

Avatar

Hi, I am a newbie to ROR. I have read the episodes and done as it says. But I'm stuck at the logout section. My application need facebook authentication only. Users can login using their facebook parameters. I only need the name and uid of the logged user. But when the second user try to login facebook not prompting the login page and redirect to my application with last login user details. could anyone help me in this. Please help me as early as possible. Thanks in advance

Avatar

Great post !
But I got error in show.html.erb, it said "wrong number of argument 1 of 0). Then I changed

<%= image_tag @user.avatar(:thumb.)to_s %> to
<%= image_tag @user.avatar.thumb.url.to_s %>

it turned ok.

Avatar

I'd like to recommend handling images on the fly with Dragonfly https://github.com/markevans/dragonfly/

Maybe an episode one day...?

Avatar

You have a scary way of posting videos on exactly what I need just a few minutes after I start struggling with it. Keep up the good work!

Avatar

The problem from posts 63 and 64 seems to be a problem with PDFKit 0.5.0. I changed my gemfile to use PDFKit 0.4.6 and the problem was gone. found the fix here "github.com/jdpace/PDFKit/issues#issue/66".

BTW thanks for all the bad ass casts Ryan. I've learned more from you than all the rails books and tutorials I've gone through combined. You freakin RULE!!!

Avatar

First off, I love your podcasts & books ryan. They have been an immense help.

I would love to see how you do "user generated forms". handeling field_types (ie. checkbox, select, etc) and moving them in positions on the form. As well as how you would handle the user inputed data for each form.

I think it would make a welcome podcast. I have been googling for days and couldn't find anything to explain best practice on how to do this.

Avatar

For those who are interested: I couldn't find a plugin for adding qrcodes to a prawn pdf, so i created one: https://github.com/torandi/prawn-qrcode

Avatar

It's excellent.
It will lower project's code review cost.
Thank you Ryan.

Avatar

Thanks a bunch for this one. I'd recommend dropping `resources :sessions` in favour of:

  get 'log_in' => 'sessions#new'
  post 'log_in' => 'sessions#create'
  get 'log_out' => 'sessions#destroy'
  
This way, if the log in fails, the location doesn't change to `\sessions`.

Avatar

Can we use unobtrusive javascript to implement features like autocomplete in jquery? or should I use the public/javscripts folder and reference each javascript that interests one of my views separately?

Please advise

Avatar

Hi, great episode.

Has anyone any idea about how to protect resources only for signed in users?

So thanks in advance!!!

Avatar

I followed many of your screencasts and your work is amazing, I loved Rails and all the great work you did solved most of my issues that I encountered in the early stages of learning this amazing framework. Keep it up!

Avatar

Fantastic screencast! Along with Part 2 these two are really fantastic, just like the rest of your stuff.

I am having an issue though. Has anybody had any problems with this railscast on Firefox? Safari works quite well but Firefox on the Mac does not seem to download the manifest after making 5 attempts to do so. So the webpage/application is not available offline in Firefox.

Avatar

Great tool - if only works...
Could you, Ryan, tell us how did you run it with Ruby 1.9.2 (if so)?
I'm talking about ruby_parser issue...
Thanks.

Avatar

Is there a way to integrate cucumber tests into code coverage somehow? All my controllers are totally untested according to them :/

Avatar

All my /edit views are rendering as pdf's too - similar to #63 -

Anyone have an idea for this??

Avatar

Hi Ryan,

  When does a user types in his login id and password using OmniAuth? Am I missing something?

Thanks,
Alex

Avatar

Oh its great! Best practices really help to refactor code learn something new. Thanx!

Avatar

Great episode. Was so happy to see you mention something I already use, simplecov. But, I need to check out these others tools.

Thanks Ryan!

Avatar

For those of you asking for rails layout with prawn. I did it, you'll find my fork of prawnto at github, see: http://github.com/phurni/prawnto

I'v done it for Rails 2.3

Cheers,

Pascal

Avatar

@David Silva: Or equals. E.g. if `abc` is nil, then give it the value 1:

    abc ||= 1

Avatar

Hi Ryan,
great screecast as usual.
I am trying to include my template from my git repository as you suggested.
I run
rails new AppName -m urltogitrepo
It does create skeleton of my app by fails to locate template. I can see it's prefix url with my current path.
Is it related to Rails3 or me doing it on windows?
Thanks
 

Avatar

@Alexander I'm having the same problem with virtually every rails app. For me it seems to be an issue with my system. Putting gem 'racc' in the Gemfile makes it work for me.

Avatar

Hi Ryan,

How would you approach writing a test case for this UrlHelper?

Seems that simply calling root_url(:subdomain => "sub") in a test doesn't make it use UrlHelper's url_for at all.

Avatar

Ryan said "I am running ruby 1.9". at 2:05. So it should be possible

Avatar

Does anyone have any links on writing test cases with beanstalker?

Avatar

And btw, what means >> ||= ?

It is in the current_user method

Avatar

Hi, is it really necessary leave the new action in session controller?

Avatar

It's not a problem with Metrical, but with flog and Ruby 1.9 specific syntax.

Avatar

@Alexander Open an Issue on Metrical

https://github.com/iain/metrical/issues

 

Avatar

Thanks Ryan for the great tutorials. My question is the same as comment #42, is it possible to sort on a column in a linked table? If so, would you explain how this could be done?

Thanks!

Avatar

uh...
I have failed to install this metrical...
git://gist.github.com/815652.git
it it so buggy?

Avatar

Great screencast, Ryan. I'm looking forward to improving a project using metrical and your coverage was just what I needed to get started. Thanks!

Avatar

I would like to thank you for your incredible work, creating this wonderful screencast!
(it indeed made me convert from php to rails ;))

Keep it up man, you're doin a great job!