Thanks for the screencast, Ryan! For a small project, this is much better than a full-blown authentication system like Devise.
I'm working on an app where I have a Customer model that should just store basic contact information and may optionally include a login with username and password. Is there any way to use has_secure_password if a password is set yet also allow for a Customer to be created without a password?
I have a blog application and would like to default to an image beaded on the category association of the post if no image is uploaded. Is this possible?
Hey guys, I modified this a little bit so that it could be used with Twitter's bootstrap framework. It allows for the TH tag to be clickable instead of making the text a link, check it out!
Great cast...I'm new to rails so this has been a big help!
I've had one issue -- in my model, I have some dates (by design) that do not have an entry. But the array seems to create a date key with 0 value for every day in the time period. I only want to graph days that have table entries - ex: 10 days out of the 3 weeks.
Currently the highcharts will graphs the no entry days as $0...this might be okay for this specific sale app, but not useful for other apps.
I have one question. Method "destroy" belongs to any rails model, so if I call it means that I violate the MVC concepts. The right way would be remove the model from the controller. Am I wrong?
I am sure you already know this, but others may not. You can combine the git submodule init and git submodule update commands and just run: git submodule update --init. You can also just use the --recursive flag on the initial clone and it will init and update the submodules automatically.
Congratulations Ryan! I'm not sure whether the Rails/Ruby community realizes how many new developers were recruited alone by your top quality screencasts.
Keep on the fantastic work! The $9 I pay for RailsCasts Pro is probably the only monthly expense that makes me smile everytime I get the receipt.
Everything seems to be working just fine for me except one thing. Every time I save a spec file and those tests get run, the time that RSpec says they finished in is actually the amount of time that Guard has been running. So the time in seconds just keeps getting bigger. Has anyone else encountered this? Any ideas how to fix it?
I'm using Ruby 1.8.7, Rails 3.1, and everything else is pretty much the same as the screencast.
This is really awesome, thanks for the screencast. Testing JS functionality is a huge improvement for me -- however, it seems to come at a pretty steep speed cost.
Is there a way to configure the specs (or more specifically, to configure Guard) to NOT run JS specs by default? I would prefer to only run those when I run the entire test suite, or if I've "enabled" js testing somehow.
Because guard calls the request spec whenever I do any work on the controller or other request specs, and because the request spec now runs selenium to test in firefox, my guard setup is now painfully slow when I'm working on anything that has associated js tests...
A follow up question: I know you usually create a topic branch for each pull request. However, once the request is accepted and what not, what do you do with said branch? Delete it, continue to branch off of it, or some sort of rebase?
Ryan, you are awesome. Hopefully this will be an amazing gift to open source project maintainers for the holidays-- you get a contribution, and you get a contribution, and you get a contribution!!!
For anyone looking for projects to contribute to, here are some projects that I know would love help:
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript inthis file: http://jashkenas.github.com/coffee-script/
alert "I knew it!"
My application runs but as soon as I go to the browser I get the following error:
unexpected token at '"ok","\n alert(\"I knew it!\");\n"]
If I take out the //= require_tree . the application works.
Can you help me if you want more info on the application here is the link to it https://github.com/Gerhardk/Battleships its a game which I am writing to get the feel of the new Rails 3.1.1 way of doing things
Thank you , didn't have time to investigate this github feature myself.
P.S.
IMO, it would be even greater idea if you would allow to participate in competition those who create new gems (like in #301) , not only those who create pull requests.
I thought 'facets', while nicely rubyish, was a confusing term until I mapped it (mentally for now) to 'filter_groups'. Always looking for good names to aid obviousity ;)
Can be interesting, but I'm really sad that the railscasts didn't really speak about rails anymore. Free railscasts continue, but in fact it's no longer free to get interesting content.
I don't want to criticize, and I don't have the right to, you did an awesome work during few years and it's normal to want to rentabilise it, I just want to make my point, that's all.
EDIT : This comment more apply in general to all episodes since the pro option, this episode was quiet interesting
I was very excited about this, but when I contacted Stripe, they said they will let me know when they will be available in Europe (England in my case) but I'm not holding my breath.
I am getting errors below on ruby192 and rails 3.1.0 when I run rails g spree:site
my gemfile contains gem "spree" instead of latest version because of dependency problem.
Also command does not modify assets css like in this tutorial and does not copy a lot of migration files.
ANY IDEAS ABOUT THOSE ISSUES THANKS!
ruby
DEPRECATIONWARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from <top (required)> at /Users/ghaydarov/Desktop/spree/config/application.rb:7)
[DEPRECATIONWARNING] NestedI18n namespace lookup under "activerecord.attributes.checkout" is no longer supported
create lib/spree_site.rb
remove public/index.html
append public/robots.txt
append db/seeds.rb
Good point! I've put a commit into docrails, the Rails documentation repository, to add a link to this guide. I've also tried to help tidy up the Initialization guide a little, as it's quite rough around the edges. It's community-maintained, so anyone else able to help should go for it.
why in this episode "/auth/twitter" suddenly redirects to twitter authentication page? its neither in routes file nor there is such an action on the controller, please explain, im struggling to understand.
Thanks for the screencast, Ryan! For a small project, this is much better than a full-blown authentication system like Devise.
I'm working on an app where I have a Customer model that should just store basic contact information and may optionally include a login with username and password. Is there any way to use has_secure_password if a password is set yet also allow for a Customer to be created without a password?
oops, wrong screen cast, I meant to put this in 3.1 Auth.
This is what I cam up with for the time being...
in case your struggling the beaded should be 'based';
what I want to know is if no image is uploaded for a post can you default to the image of the category that the post belongs to?
I have a blog application and would like to default to an image beaded on the category association of the post if no image is uploaded. Is this possible?
Hey guys, I modified this a little bit so that it could be used with Twitter's bootstrap framework. It allows for the TH tag to be clickable instead of making the text a link, check it out!
https://gist.github.com/1392144
Did you find any solutions? I've notice same thing in my site, and also even in RailsCasts site, in FF as well as in Chrome Linux versions...
Great Tutorial now only problem I have with this ( After upgrading to rails 3.1)
Missing template messages/create
I cloned the rails casts and setup the 260 after version in a clean directory.
create.js.erb is also there,
anyone an idea how to get this to work with 3.1? Thx!
This is what I cam up with for the time being...
Is it possible to do a post to create a new user via json?
I've added validates_presence_of :email, :on => :create
I'm trying.
POST /users.json HTTP/1.1
Content-Type: application/json
{
"email": "myuser@useremail.com",
"password": "1234",
"password_confirmation": "1234"
}
It picks up the email field but not the others. Is it even possible to do a post like this with the password_digest system?
For some season I am getting:
Just stumbled upon the solution: get rid of webrat from your Gemfile.
Fixed many other testing issues too.
Anyone have any ideas?
Great cast...I'm new to rails so this has been a big help!
I've had one issue -- in my model, I have some dates (by design) that do not have an entry. But the array seems to create a date key with 0 value for every day in the time period. I only want to graph days that have table entries - ex: 10 days out of the 3 weeks.
Currently the highcharts will graphs the no entry days as $0...this might be okay for this specific sale app, but not useful for other apps.
Any ideas?
Won't the browser just cache mercury.js? If so is it still necessary to stop it from loading on every request?
Hello all,
I have one question. Method "destroy" belongs to any rails model, so if I call it means that I violate the MVC concepts. The right way would be remove the model from the controller. Am I wrong?
PD: sorry, my English isn't that good.
Thanks.
I agree, gmaps4rails is a great gem. Try it first if you need to handle maps in your app.
I am sure you already know this, but others may not. You can combine the
git submodule init
andgit submodule update
commands and just run:git submodule update --init
. You can also just use the--recursive
flag on the initial clone and it will init and update the submodules automatically.Github has explicit instructions on how to do this right in the pull request.
Would love something like this where mongoid is used :)
When i try to install mercury , and run rake mercury_engine:install:migrations
i get the following error
rake aborted!
Don't know how to build task 'railties:install:migrations'
any idea why this happens ?
Nice screencast!
But I believe that screencasts that help people to grow the community like creating ruby gems should not be PRO screencasts.
Great episode, just like the 299 before :).
Congratulations Ryan! I'm not sure whether the Rails/Ruby community realizes how many new developers were recruited alone by your top quality screencasts.
Keep on the fantastic work! The $9 I pay for RailsCasts Pro is probably the only monthly expense that makes me smile everytime I get the receipt.
To another 300 episodes
Sebastian
Does this work with mongoid?
Everything seems to be working just fine for me except one thing. Every time I save a spec file and those tests get run, the time that RSpec says they finished in is actually the amount of time that Guard has been running. So the time in seconds just keeps getting bigger. Has anyone else encountered this? Any ideas how to fix it?
I'm using Ruby 1.8.7, Rails 3.1, and everything else is pretty much the same as the screencast.
Awesome, you're great, I love your screencasts :)
I ended up fixing this by rolling back my migrations and then migrating again. Anyone know why this would be necessary??
Can "my_sort_field" be a virtual attributes? I tried but no success. Do you know the way to implement this?
Ryan,
This is really awesome, thanks for the screencast. Testing JS functionality is a huge improvement for me -- however, it seems to come at a pretty steep speed cost.
Is there a way to configure the specs (or more specifically, to configure Guard) to NOT run JS specs by default? I would prefer to only run those when I run the entire test suite, or if I've "enabled" js testing somehow.
Because guard calls the request spec whenever I do any work on the controller or other request specs, and because the request spec now runs selenium to test in firefox, my guard setup is now painfully slow when I'm working on anything that has associated js tests...
+1
Thanks Ryan for this.
A follow up question: I know you usually create a topic branch for each pull request. However, once the request is accepted and what not, what do you do with said branch? Delete it, continue to branch off of it, or some sort of rebase?
Ryan, you are awesome. Hopefully this will be an amazing gift to open source project maintainers for the holidays-- you get a contribution, and you get a contribution, and you get a contribution!!!
For anyone looking for projects to contribute to, here are some projects that I know would love help:
Alternatively, you could include the application javascripts in the admin package and only serve that on admin pages.
Hey Ryan I am follower of railscasts it has helped me out of trouble and understanding the way things work thanks alot. The new layout looks awesome.
I have a bit of a problem with coffiescript:
My gem file:
In the application layout:
In my application.js:
In my games.js.coffie:
My application runs but as soon as I go to the browser I get the following error:
unexpected token at '"ok","\n alert(\"I knew it!\");\n"]
If I take out the //= require_tree . the application works.
Can you help me if you want more info on the application here is the link to it https://github.com/Gerhardk/Battleships its a game which I am writing to get the feel of the new Rails 3.1.1 way of doing things
Thanks Gerhard
Ryan,
It looks like you blog-after directory in the source code is not updated with the format_url method.
Excellent cast. Here is a link to the Engine Yard Blog mentioned in the screen cast.
Great!
Here is the link to Readme Driven Development by Tom Preston-Werner
Thank you , didn't have time to investigate this github feature myself.
P.S.
IMO, it would be even greater idea if you would allow to participate in competition those who create new gems (like in #301) , not only those who create pull requests.
Thanks Ryan. This is the first time I have seen any step-by-step tutorial on how to do it. Most documentation just says, fork & pull, and it's easy.
On the flip side, do you plan to do a video on how to accept and integrate pull requests for open source contributions?
I thought 'facets', while nicely rubyish, was a confusing term until I mapped it (mentally for now) to 'filter_groups'. Always looking for good names to aid obviousity ;)
Can be interesting, but I'm really sad that the railscasts didn't really speak about rails anymore. Free railscasts continue, but in fact it's no longer free to get interesting content.
I don't want to criticize, and I don't have the right to, you did an awesome work during few years and it's normal to want to rentabilise it, I just want to make my point, that's all.
EDIT : This comment more apply in general to all episodes since the pro option, this episode was quiet interesting
As it is now, metrical seems not to work anymore, I get following message when installing:
Are there alternatives to metrical?
Found a way to get this working using the stache gem.
Useless to anyone outside of the US :(
I was very excited about this, but when I contacted Stripe, they said they will let me know when they will be available in Europe (England in my case) but I'm not holding my breath.
THANKS FOR THE TUTORIAL.
I am getting errors below on ruby192 and rails 3.1.0 when I run rails g spree:site
my gemfile contains gem "spree" instead of latest version because of dependency problem.
Also command does not modify assets css like in this tutorial and does not copy a lot of migration files.
ANY IDEAS ABOUT THOSE ISSUES THANKS!
Just stumbled across this awesome tutorial. Combined this with my ActiveAdmin dashboard for some nice results. :)
This was very interesting Ryan, thank you. I hope to see more screencasts on Rails' internals in the future!
Good point! I've put a commit into docrails, the Rails documentation repository, to add a link to this guide. I've also tried to help tidy up the Initialization guide a little, as it's quite rough around the edges. It's community-maintained, so anyone else able to help should go for it.
why in this episode "/auth/twitter" suddenly redirects to twitter authentication page? its neither in routes file nor there is such an action on the controller, please explain, im struggling to understand.
Make sure you re-index and try using string again because I know for decimal you have to use float and for date you have to use time.