Couldn't be more getting Pry right away: am running win764 bit, for some reason, I never can get color highlighting to work ANYWHERE; not even with a freshly installed system following every guide to the dot. If anyone here knows, please please enlighten.
WOW !!!!! been using this the whole day.....this is freaking awesome. Just tested it with RC6 rails and Sinatra...I think this is the best day of this month !
I have to admit I was disappointed when I saw the topic for this week's railscast. The name and description just weren't what I was hoping for. Each week I look forward to learning a new way to use ruby/rails to solve problems by writing code. Pry was just a replacement for irb "UGH".
THEN . . . I watched it.
Wow. Thank you, Ryan. I'm betting that in less than a week, Pry will have saved me hours worth of time.
Lesson learned: Never judge Ryan's screencasts before watching them.
Anyone else experiencing problems with reloads for 'edit-method' and command line vim ?
It doesn't seem to reload the code after editing (:wq), only after another edit-method (so it looks like vim is handing back control to pry immediately after loading the file, and pry loads the unchanged module, rather than the changed one after save/quit).
Great cast!
I have a question for you: with 3.1stable coming, do you think that the trick of using an id for a specific controller will be necessary anymore?
I would also like to see the tdd in every episode. i also miss in every book and many aricles the tdd style to show also the test style. It looks for me like everybody claim to do testing but nobody show how he do this. For a beginner with rails and testing this would be a good starting point to digg into the secrets of testing.
As you write the test everybody see the what code you write next.
The argument the episode becomes too long is not accepted ;-).
You can speed up things if you not switch always to the test results and not explain what to do next because of the test fail. You should only give a litte space of the screen to the test green dots or error dots (and maybe the importent part of the test fail message). Then you just do write test and implememt code. The log from the specs are shown in the same time at a split screen and do not need explaination.
@nathan le Ray you can pull from my github a modified version of albino that allows you to pass options to pygments. https://github.com/austinbv/albino. To use this version of albion in your gemfile just add
Thanks Ryan, for such a great episode. But I have come with a question..?
I would like to have a default check_box button so that all the fields are selected and the ids, are sent through post request. could you guide through...
I'm following this and it all goes well, image seems to process etc, but when I view the file it has just cropped from the center of the image and not the cropping area :(
Anybody have got this working with rails 3.1? I'm curious because it isn't working in my 3.1 project, it was okay in 3.0.* . The problem is that when I want to type in something in this input area I've got "Searching..." message and no results listed at all, only when text doesn't match database entries I've got "no results" message. I've tried to add some pre data into the database manually, unfortunately in the result i have pre-populated input with "undefinded x" instead of name I wrote to join table. Maybe somebody had similar problem?
I guess what you mean is: "how do I include /admin.js alongside my general CSS stylesheet in the admin view in a single file ?"
Your JS files aren't supposed to be regenerated every request, and won't in production - so I would discourage using Donnie's solution.
The only solution is to include your 'screen' stylesheet in your admin stylesheet and include only the 'admin' stylesheet in your layout like Dmytrii suggested.
Heroku precompiles assets for you during push, in the cedar stack. However, it is broken for 3.1 rc6, They are working on fixing it.
About the read only file system:
"Cedar offers an ephemeral writeable filesystem. You can write out to disk anywhere you would like. Your changes will be lost on dyno restart and spin-up."
Great screencast! You should probably link to the current asset pipeline docs on github. There have been a lot of changes to the docs since Ryan posted that page!
Ryan,
Thanks for this. I am running into some problems with my functional tests
1) Failure:
test_should_create_user(UsersControllerTest) [/test/functional/users_controller_test.rb:20]:
"User.count" didn't change by 1.
expected but was
.
2) Failure:
test_should_update_user(UsersControllerTest) [/test/functional/users_controller_test.rb:39]:
Expected response to be a <:success>, but was
Is there a way to reload the environment like
reload! from IRB ?
Thanks for the the great RailsCast, Ryan - as always.
Has anyone figured out if it's possible to use 'binding.pry' for debugging if you're using Apache/Passenger rather than the built-in server?
Yes, here is how to replace the rails console with pry
For those that don't like to click links:
Thanks a lot! I know, I'm a digger, but it's still working! Saved my life. :)
Couldn't be more getting Pry right away: am running win764 bit, for some reason, I never can get color highlighting to work ANYWHERE; not even with a freshly installed system following every guide to the dot. If anyone here knows, please please enlighten.
bye rails console
Any way to replace the console with pry in 2.3.8 when you run
???
Hello Ken,
Haven't tried yet. Thanks for letting me know. I will install it now.
Great Tip! THX!
It is also worth noting that for this to work
gem 'pry'
must be in yourGemfile
.i get an undefined method:
undefined method page for #<Array:0x109881fa8>
@images = @search.results.page(params[:page]).per(24)
WOW !!!!! been using this the whole day.....this is freaking awesome. Just tested it with RC6 rails and Sinatra...I think this is the best day of this month !
@Austin Thank you, I'll try that.
I have to admit I was disappointed when I saw the topic for this week's railscast. The name and description just weren't what I was hoping for. Each week I look forward to learning a new way to use ruby/rails to solve problems by writing code. Pry was just a replacement for irb "UGH".
THEN . . . I watched it.
Wow. Thank you, Ryan. I'm betting that in less than a week, Pry will have saved me hours worth of time.
Lesson learned: Never judge Ryan's screencasts before watching them.
I just set it up using RC6, it seems to be working just fine, is that not the case for you?
I have this working with Kaminari, what is the problem you are having?
Try:
gem "sunspot_matchers"
gem "sunspot-rails-tester"
Is anyone using Pry with Rails 3.1 RC5/RC6?
Thanks.
Bharat
thank you Ryan!
finally a tool to see the source code of a method definition!
That was really a feature I missed from Lisp..
Joshua Cheek's screeencast is also worth seeing, and includes a neater way to use Pry as IRB replacement for the rails console:
Simply add the following lines at the end of your config/environments/development.rb file, after the
YourAppName::Application.configure
block:And no more need to use the longer
pry -r config/environment
to start the console: simply use the usualrails console
/rails c
command.Another great discovery Ryan! Do you know if Pry works with Ruby 1.8.7 or is it just for Ruby 1.9?
Anyone else experiencing problems with reloads for 'edit-method' and command line vim ?
It doesn't seem to reload the code after editing (:wq), only after another edit-method (so it looks like vim is handing back control to pry immediately after loading the file, and pry loads the unchanged module, rather than the changed one after save/quit).
Works with nano, though.
This is certainly my favorite code excerpt:
```ruby
Hi Ryan,
Great cast!
I have a question for you: with 3.1stable coming, do you think that the trick of using an id for a specific controller will be necessary anymore?
thanks and cheers
How on earth did you get this gem installed? I'm running into all sort of trouble on OSX Lion. I keep getting stuck on this nokogiri dependency where it complains about missing libiconv. I've followed the directions on the nokogiri site and this guy http://pinds.com/2011/08/06/rails-tip-of-the-day-rails-os-x-lion-rvm-nokogiri/comment-page-1/ but no such luck
Yes, awesome rails cast as usual!
I did a few blog posts on asset related rails awhile back, might be of interest?
http://house9.blogspot.com/2011/05/rails-31-asset-pipeline.html
http://house9.blogspot.com/2011/05/rails-31-javascript-execution.html
http://house9.blogspot.com/2011/06/rails-31-asset-gem.html
I would also like to see the tdd in every episode. i also miss in every book and many aricles the tdd style to show also the test style. It looks for me like everybody claim to do testing but nobody show how he do this. For a beginner with rails and testing this would be a good starting point to digg into the secrets of testing.
As you write the test everybody see the what code you write next.
The argument the episode becomes too long is not accepted ;-).
You can speed up things if you not switch always to the test results and not explain what to do next because of the test fail. You should only give a litte space of the screen to the test green dots or error dots (and maybe the importent part of the test fail message). Then you just do write test and implememt code. The log from the specs are shown in the same time at a split screen and do not need explaination.
@nathan le Ray you can pull from my github a modified version of albino that allows you to pass options to pygments. https://github.com/austinbv/albino. To use this version of albion in your gemfile just add
Thanks Ryan, for such a great episode. But I have come with a question..?
I would like to have a default check_box button so that all the fields are selected and the ids, are sent through post request. could you guide through...
cheers
Great episode Ryan. Routing has been a pet peeve of mine for a long time now.
Hopefully with this episode and some more reading, it will never come back to haunt me in the future.
Hello,
I would like to know if there is a way to show the line numbers for the code blocks generated through Albino.
Thanks.
Just incase anyone else has my problems, I managed to fix this by removing all previous paperclip plugins and reinstall the gem
Hi Matenia,
I think I'm having the same problem as you, how did you fix this? (I know it's ages ago, sorry)
I'm following this and it all goes well, image seems to process etc, but when I view the file it has just cropped from the center of the image and not the cropping area :(
Anybody had this? Does anyone have any ideas?
Thanks in advance!
Anybody have got this working with rails 3.1? I'm curious because it isn't working in my 3.1 project, it was okay in 3.0.* . The problem is that when I want to type in something in this input area I've got "Searching..." message and no results listed at all, only when text doesn't match database entries I've got "no results" message. I've tried to add some pre data into the database manually, unfortunately in the result i have pre-populated input with "undefinded x" instead of name I wrote to join table. Maybe somebody had similar problem?
Anyone faced with this problem?
When I do like this:
And then try to destroy article in model of which has line:
Comments are not deleted!
Just FYI, in my 3.1 rc6 app I'm getting
DEPRECATION WARNING: stream class method is deprecated. Please give the :stream option to render instead.
I guess what you mean is: "how do I include /admin.js alongside my general CSS stylesheet in the admin view in a single file ?"
Your JS files aren't supposed to be regenerated every request, and won't in production - so I would discourage using Donnie's solution.
The only solution is to include your 'screen' stylesheet in your admin stylesheet and include only the 'admin' stylesheet in your layout like Dmytrii suggested.
Use the rails-dev-tweaks gem and you have your speed back. ;-)
Heroku precompiles assets for you during push, in the cedar stack. However, it is broken for 3.1 rc6, They are working on fixing it.
About the read only file system:
"Cedar offers an ephemeral writeable filesystem. You can write out to disk anywhere you would like. Your changes will be lost on dyno restart and spin-up."
From: http://devcenter.heroku.com/articles/read-only-filesystem#cedar
Hi!
Great screencast! You should probably link to the current asset pipeline docs on github. There have been a lot of changes to the docs since Ryan posted that page!
Ryan,
Thanks for this. I am running into some problems with my functional tests
1) Failure:
test_should_create_user(UsersControllerTest) [/test/functional/users_controller_test.rb:20]:
"User.count" didn't change by 1.
expected but was
.
2) Failure:
test_should_update_user(UsersControllerTest) [/test/functional/users_controller_test.rb:39]:
Expected response to be a <:success>, but was
Hey...Anyone else having problems with validations?
Ny solutions?
Always a new stuff, thanks Ryan.
Simple
Timecop.freeze
doesn't work with Oracle db, because:ORA-01841: (full) year must be between -4713 and +9999, and not be 0
A time must be specified for example
Timecop.freeze(DateTime.now)
Yeh I'm trying to figure out the same thing
I'm not getting the port number in the url when firefox launches (only 127.0.0.1). Do I have to specify the port somewhere?
Don't know where in the rails stack this logic is executed, but if there is access to instance variables per request then you could:
Add .erb onto the end of your application.js file => application.js.erb
Do something like:
I just set this up using CanCan for authorization. Works great!
I also added a check in the session controller to make sure the user isn't already logged in when visiting the login path:
WOOT! I am very very glad to see my Railscast request was featured! +1 So very useful thanks Ryan!
Also I may have missed it but how does one handle naming conflicts? I'll re-watch...
You may want get wildcard to localhost working by
http://hints.macworld.com/article.php?story=2005110220352084&query=launchd+named+localhost
so, it's possible to localhost
my.dev.box.localhost, foo.localhost, so on
thanks for this episode
I'm getting the same error, in production. Did you figure it out?