RailsCasts Pro episodes are now free!

Learn more or hide this

Recent Comments

Avatar

I'm also getting this error:

wrong number of arguments (0 for 1)

using simple_forms, even with your syntax above which, by the way, has a small typo, the last closing parentheses should be a curly brace.

Funny enough, I get this same error even if I don't use simple forms, just a regular form_for tag.

Any help would be greatly appreciated.

Avatar

How to config rubber to utilize the free tier? In rubber.yml it seems you can only choose between m1.small not m1.micro

Avatar

I have also tried the stache gem but couldn't make it work with haml. I'm now using an answer on StackOverflow to include haml in the template handler but it doesn't work with chained template extensions (e.g. _foo.html.haml.mustache).

Any ideas? Thanks!

Avatar

As I am in Europe! I would like to use eu-west-1. I can't get that to work. If I simply switch to us-east-1 it works. Why is that?

Avatar

I love Select2 - I started with Chosen, but ended up going with Select2 for the flexibility and great looking (bootstrap friendly) styles.

Using it on a submission form on metajury.com

Avatar

You don't need DNS out of the box since rubber will write your host entries to /etc/hosts. But if you do want DNS, rubber can manage that as well. Look at the config/rubber/rubber-dns.yml template to get started.

Avatar

@robbied72, for the first year, it'd be much cheaper, since you can most likely get away with the Amazon free tier, which gives you a micro instance free for a year.

Avatar

I really enjoyed this webcast. I'm learning a lot about RoR development daily :)

I recently stumbled upon an alternative to Janrain Engage. A product that is in development from a group called LoginRadius

Noticing that the team didn't have a RoR integration I decided to create my first gem to enable others to leverage their solution in their apps.

Note I am in no way affiliated with LoginRadius!

Avatar

A friend of mine has put together a select2-rails gem if anyone is interested.

Avatar

how do i point the domain to ec2?? just linking the ip or do i need to set up an extra dns server??

Avatar

Modify the "domain" setting in config/rubber/rubber.yml.

Avatar

I would like to know how to match my own domain name instead of foo.com.

Thanks.

Avatar

Ryan - Thanks for another great episode.

Anyone using Chosen with Twitter Bootstrap? Any issues?

Avatar

Follow @fabiano's link, create the registrations controller then replace '/an/example/path' with '/user_steps' . Hope this helps

Avatar

Getting error of Rails: rake db:create:all (could not connect to server)

could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

http://stackoverflow.com/questions/10482853/rails-rake-dbcreateall-could-not-connect-to-server

Avatar

What kind of cost could I expect for a small site with say between 100 and 500 hits per day? Would it work out cheaper than a linode vps in this case?

Avatar

This step-by-step-tut is not written for rails 3.2, is it?

Avatar

The AMIs only work in the region they were created in. If you want to use us-west-1 with Ubuntu 12.04, the AMI you want is ami-e7712aa2.

Check out the sidebar on http://alestic.com/ to get a listing of Ubuntu AMIs by region and type.

The timezone setting is just the standard set of timezone mappings from Ubuntu. If you're on the west coast, I guess "America/Vancouver" would do what you want.

Avatar

data-source for index action is
data-source="<%= products_url(format: "json")

how to code same for something like show action(member action) ??

Avatar

Thanks, great cast, and just in time for me.

When I configure AMI for us-east-1 things seems to work. But if I change the aws: to region: eu-west-1 even the staging fails with a AMI ID '' does not exist. Any ideas how to solve this? Also what shall I specify for time zone instead of US/Eastern

Avatar

Thank you Rees, Im a better man now that i can spell .. :)

Avatar

Hi Ryan,

I am new to rails. In my application i integrate the paypal by following episode 146. In that i didn't get the order summary. For that what can i do??? Can u help me out. Thanks.

Avatar

No its not. It seems you are confusing attr_accessible with attr_accessor.

Avatar

Awesome episode. Thanks Ryan.

Is there a way to configure Chosen to support the inline create option?

Avatar

I've a little question about Ruby: at 5:46, when Bates wrote attr_accessible :author_tokens, attr_reader :author_tokens will be optional, right?

Avatar

Another excellent and very useful episode. Folks, there is a pattern here. When Ryan says, "Hold on to your seats." He is not kidding. That is when he is at his best :) Hey Ryan, please make a point of saying that every week in either the "Pro" or the "Revised" episodes :)
Best regards,
Bharat

Avatar

Hey Ryan, how could we validate these virtual attributes? I can validate without any problems the id that these _name setters refer to, but I can't output the feedback on the form. How could I do that? Thank you.

Avatar

On 12.04, I ran into an error about the admin group not existing. All I had to do to fix it was run groupadd admin. The group is already listed in the sudoers file, it just wasn't created when the distro was installed.

Avatar

Thank you, just what i was looking for.

Avatar

Is the uid returned remains the same when an user authenticates via omniauth (twitter,facebook etc)? Can I use it as an identifier/foreign key in another model where they are able to provide extra details such as their website? If uid is going to be dynamic (for instance every time they login), then is there a way to relate their extra details with their uid?

Avatar

Very nice! Looking forward to the upcoming releases.

Avatar

Hi!

Thanks thanks Ryan Bates for this Interesting cast.
Can I use a wicked wizard to another model than the User.

Thanks for any help
Bardach

Avatar

In order for this to work you have to use the following syntax:

javascript
$("#article_project_tokens").tokenInput($("#article_project_tokens").data("token-source"), {
  prePopulate: $("#article_project_tokens").data("pre"),
  preventDuplicates: true
});

Not sure why this is the case. The preventDuplicates option is just to show for extra options that a comma is needed (but it is super useful).

Avatar

Great episode, but shouldn't the token source be based on a path or url function like this?

javascript
$("#article_co_author_tokens").tokenInput $("#article_co_author_tokens").data("token-source")
  prePopulate: $("#article_co_author_tokens").data("pre")
ruby
f.input :co_author_tokens, label: false, input_html: {data: {token_source: search_usernames_path, pre: @article.co_authors.only(:id,:username).map(&:attributes).to_json}}

Please note this is from a project that uses Mongoid and SimpleForm.

Avatar

TokenInput seems great. It strikes me as a great solution for tags. Any comments on this?

Avatar

'ilike' dosn't work for mysql.
MySql has an alternative: 'select * from foo where upper(bar) like upper(?)'.

preventDuplicates is really useful, thanks

Avatar

Great episode Ryan, but i think is better to use:

ilike

instead of using:

like

To avoid problems with case sensitive strings.

And another tip for using TokenInput is to set the option of:

preventDuplicates: true

Avatar

I do the following:

before_filter :clear_medicine_ids, only: [:create, :update]

def clear_medicine_ids
@medical_consultation.medicine_ids = [] unless params[:medical_consultation][:medicine_ids].present?
end

Avatar

I am using Mongodb/mongoid with my Rails project. I followed the steps given. Most of things worked. But I am stuck at making mongo to work.

  1. the screencasts makes heavy use of config/database.yml. Should I do the same with config/mongoid.yml and make copy to config/mongoid.example.yml? What other files should I modify?

2 I suppose I should install Mongodb on Linode server and just keep it runing and pointing the production server to localhost in my mongoid.yml file. Does that sound right?

3 I wanted to make things generally working without setting up mongoid.yml correctly. But then because I have database.yml there with unused sqlite3 reference, cap deploy:cold gives error about sqlite3 not in the gemfile. I suppose if I remove config/database.yml altogether, it should not ask me to include sqlite3 any more?

These questions might be too specific to my situation. But any links to relevant information that can help me would be really appreciated.

Avatar

Hey, you are missing when user did not select any item on the list, episode-258 / revised / bookstore-chosen-after.

Avatar

Thanks a lot Ryan! This episode is just amazing! I was looking for a tutorial like this for months!

Avatar

You'll get these for a bit. There's a delay between when Amazon indicates the machine is available and when we can actually SSH into it. If it doesn't resolve itself after a few minutes, then something is wrong. But if you only see them for a couple minutes, it's nothing to worry about. EC2 is pretty variable about instance startup time.

Avatar

Rubber should handle this for you. By default, the current version of rubber (2.0.1) uses ami-3c994355, which corresponds to the 64-bit instance-store Ubuntu 12.04 LTS image.

Feel free to hop onto #rubberec2 on Freenode and I'll try to help out.

Avatar

check out https://github.com/mon-ouie/pry-remote
use binding.pry_remote in your code, and
and then from another terminal
pry-remote to connect

Avatar

I used your previous snippet and modified it, This should help you out.

$("#article_project_tokens").tokenInput($("#article_project_tokens").data("token-source"), {
crossDomain: false,
prePopulate: $("#article_project_tokens").data("pre"),
theme: "piplanet",
preventDuplicates: true,
tokenLimit: 10,
queryParam: "query",
minChars: 4,
hintText: "Start typing a project's name..."
});

<%= f.input :project_tokens, label: false, input_html: {data: {token_source: search_project_names_path, pre: @article.projects.only(:id,:name).map(&:attributes).to_json}} %>

You'll probably have to change this, it was written in an app that uses Mongoid.

Avatar

Once again, you read my mind with this week's episode topics! Thanks a ton Ryan, keep up the great work.