Anyone seeing the pjax links make the "page request" twice? Tried various configurations, but every pjax link makes 2 requests; the first with _pjax=true and the second without _pjax. I've changed the jquery-pjax plugin timeout to 30000 (in ms) and still no luck. I've tried various browsers, and they all are doing the something. Any suggestions?
One of the best casts I've seen from you! Big +1 for covering insufficient funds and cancellation. Would be a shame not to do it now that you refactored everything nicely into its own model. :)
It degrades gracefully for those browsers: jquery-pjax won't intercept clicks when the browser doesn't support pushstate, making the link just a normal link.
When u say 'maybe i can do something with rack'
what u mean? what means a rack app?
its something inside rails? its is a modeling pattern? where i can found material about?
I am sure I am just not getting it, but it seems that decorators are just sweeping dirt under the rug. Every time I see changes like this that alter the way apps are written by making them more complex in the name of cleanliness, I feel that it is just one more thing that stands between me and delivering a product to my clients that can be handed off to other developers easily.
I think Jeff is a great guy.. We hung out in Salt Lake City way back and I realized the guy knows his stuff.. This is why I don't want to discount the idea in my head, but are we trying to solve a problem that might not need to be solved? And in turn, are we making it more complex?
wow - monster cast! love your work Ryan and i'm happy to start paying you some money for Pro as you have taught me so much over the years / every day still! i'm UK based and as Jon Hope said, online payment solutions in the UK are in the dark ages and PayPal is a safe route. i don't think a WPP account is necessary though, a Standard Business account should suffice when using the PP Express Checkout approach (source: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECGettingStarted) ... and i quote from there:
To use Express Checkout, you must have: A Business or Premier account. A Business or Premier account enables you to become a merchant for whom PayPal collects money from buyers for goods or services. PayPal manages these transactions and charges you a small fee and a percentage of the amount collected from the buyer for each transaction.
I hope that helps clear up some confusion for British (and probably German) customers.
How would I make HTTP basic authentication conditional? For example, I have a staging server at work, and I only want to make people authenticate if they access the server from outside the local network.
With this, I am always prompted to authenticate—even if needs_authentication? explicitly returns false. Moving http_basic_authenticate_with inside a method doesn't seem to work, either—I get an undefined method error.
+1 - Handlebars + handlebars_assets gem does this but the templates need to be required into application.js. Would be good if they were automatically compiled from your view directory
I love using factories, but for some reason I got frustrated with the factory_girl syntax on a recent project and ended up justing creating my own factories.rb file in the support/ directory that didn't use an external gem.
It is surprisingly easy to do in plain old active record with a familiar syntax, so now I'm not sure it even warrants a separate gem. May just be personal preference though.
We're trying to use this plugin but it's not working and I have a feeling it's because we aren't converting that tag to HAML correctly. Anyone using HAML with this?
For others getting Errno::ECONNREFUSED: Connection refused - connect(2) errors when testing Solr-enabled models with Cucumber, put this in your env.rb file:
Sunspot::Rails::Server.new.start
at_exit do
Sunspot::Rails::Server.new.stop
end
This will start up your solr server when your tests start, and shut it down afterwards.
Nice... however when I run bundle it complains about a gemfile conflict
Bundle
Bundler could not find compatible versions for gem "nokogiri":
In Gemfile:
rack-pjax (>= 0) x86-mingw32 depends on
nokogiri (~> 1.4.4) x86-mingw32
cucumber-rails (>= 1.1.1) x86-mingw32 depends on
nokogiri (1.5.0)
Here's something I grabbed from the Jasmine Google Group:
By default Jasmine will load files you place in spec/javascripts/helpers. You'll want to put the version of jquery that Rails provides (and jquery-ui, if you're using it) in there in order for Jasmine to be able to load it for your tests. Rails normally provides these to the asset pipeline via the jquery-rails gem, which jasmine doesn't yet interact with.
Hi Ryan...Are you using this on railscasts.com? I noticed there is a bug...when you are on an episode page, click on one of the tabs like comments (I'm assuming this is using pjax). Then type in google.com and press the back button. It shows the pjax request code instead of reloading the full page.
Good question, needing to run bundle exec depends on how your system is setup. Here I'm only installing gems through bundler (there is no Rails gem installed on the system outside of Bundler) so I need to use bundle exec. It's also a good idea to always use this to ensure you're working with the proper version of the gem.
On my development machine I am using Oh My ZSH with the Bundler plugin which sets up aliases for these commands so I don't need to type in "bundle exec" in development.
I'm not certain. Is the mail delivery method working? Try experimenting with it in the Rails console on your production server and see if it sends email.
Anyone seeing the pjax links make the "page request" twice? Tried various configurations, but every pjax link makes 2 requests; the first with _pjax=true and the second without _pjax. I've changed the jquery-pjax plugin timeout to 30000 (in ms) and still no luck. I've tried various browsers, and they all are doing the something. Any suggestions?
One of the best casts I've seen from you! Big +1 for covering insufficient funds and cancellation. Would be a shame not to do it now that you refactored everything nicely into its own model. :)
I managed to figure it out :)
It degrades gracefully for those browsers: jquery-pjax won't intercept clicks when the browser doesn't support pushstate, making the link just a normal link.
You can use it this way:
It is especially handy when you have several "data-" attributes, this way you don't have to repeat the "data-" part.
There is a list of available vagrant box packages which is not including Fedora yet: http://www.vagrantbox.es/
I think you have to create your own through VirtualBox (select your operating system and version at the Create Virtual Machine Wizard, Fedora available?) in consideration of vagrant's guidelines for virtual boxes (http://vagrantup.com/docs/base_boxes.html): https://www.virtualbox.org/manual/ch01.html#gui-createvm
Then you have to package the box through vagrant: http://vagrantup.com/docs/base_boxes.html
Anybody know how to configure sunspot/solr to imitate textmate's command-t like searches?
it would help if 'safe' were a word i could spell
I've just run into 'undefined method `urlsaf_base64' for SecureRandom:Module' on ruby 1.9.2p290
jquery-pjax isn't compatible with browsers not supporting pushstate, like all released IEs. A trade-off between convenience and compatibility.
I found the answer back in episode #82:
When u say 'maybe i can do something with rack'
what u mean? what means a rack app?
its something inside rails? its is a modeling pattern? where i can found material about?
Wow, thank you VERY MUCH, tguevin!! I will absolutely give it a try! :)
I really appreciate your help.. you've made my day :P
It's good, but I have some problems with graphics.
I am sure I am just not getting it, but it seems that decorators are just sweeping dirt under the rug. Every time I see changes like this that alter the way apps are written by making them more complex in the name of cleanliness, I feel that it is just one more thing that stands between me and delivering a product to my clients that can be handed off to other developers easily.
I think Jeff is a great guy.. We hung out in Salt Lake City way back and I realized the guy knows his stuff.. This is why I don't want to discount the idea in my head, but are we trying to solve a problem that might not need to be solved? And in turn, are we making it more complex?
In the AsciiCasts version there's a typo
data: <%= orders_chart_series(orders, 3.weeks.ago) %>
should say
data: <%= orders_chart_series(order, 3.weeks.ago) %>
see my post below Hannes H. - you should be OK.
wow - monster cast! love your work Ryan and i'm happy to start paying you some money for Pro as you have taught me so much over the years / every day still! i'm UK based and as Jon Hope said, online payment solutions in the UK are in the dark ages and PayPal is a safe route. i don't think a WPP account is necessary though, a Standard Business account should suffice when using the PP Express Checkout approach (source: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECGettingStarted) ... and i quote from there:
I hope that helps clear up some confusion for British (and probably German) customers.
"rails mailit" don't work, is that "rails new mailit"
Hello Ryan
Great screencast.
I was wondering, is it possible to use the pjax functionality with a search button instead of a link?
Whem I try I get this
No route matches [GET] "/undefined"
Thank you this was very helpful even though devise has changed a little.
How would I make HTTP basic authentication conditional? For example, I have a staging server at work, and I only want to make people authenticate if they access the server from outside the local network.
With this, I am always prompted to authenticate—even if
needs_authentication?
explicitly returns false. Movinghttp_basic_authenticate_with
inside a method doesn't seem to work, either—I get anundefined method
error.Is Ubuntu the only supported VM for vagrant? It would be nice to have support for Fedora/RH as well.
+1 - Handlebars + handlebars_assets gem does this but the templates need to be required into application.js. Would be good if they were automatically compiled from your view directory
I also wonder how you would reuse the template with Rails 3.1 assets pipeline and JST?
Another thing is that I would probably use Spine.js or similar for infinite scrolling: http://vimeo.com/30796067
BTW, you can use jQuery waypoints to deal with scrolling.
I love using factories, but for some reason I got frustrated with the factory_girl syntax on a recent project and ended up justing creating my own factories.rb file in the support/ directory that didn't use an external gem.
It is surprisingly easy to do in plain old active record with a familiar syntax, so now I'm not sure it even warrants a separate gem. May just be personal preference though.
VCR for me has been a total game changer. Here is a snip-it to create a @vcr tag for cucumber scenarios:
Thanks, that worked great
Thanks. This plugin still isn't working for me so I guess that wasn't the issue.
%div(data-pjax-container="true")
Works the same and still looks semantic.
How do you create the following div in HAML?
We're trying to use this plugin but it's not working and I have a feeling it's because we aren't converting that tag to HAML correctly. Anyone using HAML with this?
Take a look at faker for generating unique object data.
For others getting Errno::ECONNREFUSED: Connection refused - connect(2) errors when testing Solr-enabled models with Cucumber, put this in your env.rb file:
Sunspot::Rails::Server.new.start
at_exit do
Sunspot::Rails::Server.new.stop
end
This will start up your solr server when your tests start, and shut it down afterwards.
I just released a new version of rack-pjax, it includes specs and fixes this issues as well.
Nice... however when I run bundle it complains about a gemfile conflict
Here's something I grabbed from the Jasmine Google Group:
By default Jasmine will load files you place in spec/javascripts/helpers. You'll want to put the version of jquery that Rails provides (and jquery-ui, if you're using it) in there in order for Jasmine to be able to load it for your tests. Rails normally provides these to the asset pipeline via the jquery-rails gem, which jasmine doesn't yet interact with.
Hope this helps!
Thanks for using Jasmine!
Rajan
There is an error in the notes for pjax_rails. The manifest file should just be
//= require pjax
I confirm this bug. Steps to reproduce:
Edit: It has already been reported on Github
Wael
Great screencast! Definitely a +1 for Part II; covering insufficient funds and cancellation would be really appreciated. Thanks!
+1. Best $10 ever.
Thanks Ryan.
For those who wants to try out Handlebars, you might want to take a look at
https://github.com/leshill/handlebars_assets
It compiles your handlebars templates with the rest of your assets. Pretty neat
Hi Ryan...Are you using this on railscasts.com? I noticed there is a bug...when you are on an episode page, click on one of the tabs like comments (I'm assuming this is using pjax). Then type in google.com and press the back button. It shows the pjax request code instead of reloading the full page.
I didn't find this to be the case on my setup, but you may be right as I'm not the most proficient at Ubuntu. Thanks for mentioning.
Yes, with rbenv or rvm.
More episodes on deployment are planned, thanks for the feedback.
Haha, had a bad cold that really messed with my voice.
Good question, needing to run
bundle exec
depends on how your system is setup. Here I'm only installing gems through bundler (there is no Rails gem installed on the system outside of Bundler) so I need to usebundle exec
. It's also a good idea to always use this to ensure you're working with the proper version of the gem.On my development machine I am using Oh My ZSH with the Bundler plugin which sets up aliases for these commands so I don't need to type in "bundle exec" in development.
I'm not certain. Is the mail delivery method working? Try experimenting with it in the Rails console on your production server and see if it sends email.