If you have problems with url helpers while running zeus, I could be wrong but believe it's because of this here.
I applaud that effort to optimize time, but like spork, I've kicked zeus to the curb. They make the test environment just a little too dissimilar from the production and development environments. I wind up spending a lot of time tracking down bugs in my code... or my tests... only to learn it's neither; it's my testing environment flaking out. So how much time is it really saving? (BIG fan of guard, though.)
Hello. I have a problem. This app use sqlite3, but i need postgresql. I edit my Gemfile and database.yml. My app work in rails server, but on heroku doesn't. May be it's needs to edit something other. Write me please, what i needs to edit to use postgersql.
Same problem here. If I run "cap deploy" after a failed "cap rubber:create_staging" deployment I'll get the following error:
** [out :: production.blog.com] rake aborted!
** [out :: production.blog.com] could not connect to server: Connection refused
** [out :: production.blog.com] Is the server running on host "production.blog.com" (10.210.xxx.xx) and accepting
** [out :: production.blog.com] TCP/IP connections on port 5432?
Any other ideas how to fix this Mongo::ConnectionFailure? The last time I deployed (4-5 months ago everything worked like a charm). Updated to latest rubber version.
I've been dealing with this problem a lot lately while building a multi-tenancy app. Corey Haines' view on TDD is very interesting, and I encourage anyone interested to check out his brand new screencast episodes on Clean Coders.
Only one problem with zeus and guard:
When we are using it, randomized with seed is always 0. Any solutions/suggestions? Is not a very big deal nonetheless.
Ryan, FactoryGirl.build implictly creates records in database when it has associations. Maybe it's better to use just Model.new for things like validations instead of build()?
Been finding the solution online for a while. Most of them give the adding the if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi which is a must have.
Even after adding this line , rails still errors. I have to remove .rvm association from export path like you mention here. Solved!
Just thought I'd mention that !! works in bash, but it doesn't auto-expand like that. I wasn't aware of it... hopefully I don't forget before I have occasion to use it.
Rouge is great gem for syntax highlighting and it's written in pure Ruby. I've written blog post with simple Rouge configuration with Redcarpet in Ruby on Rails.
at 8:07.. How would I return more than just the name of the object?
I need to supply several other attributes as well although I'm having a hard time finding a simple explanation for using .map to return other attributes as well.
I am trying to query all of the Users that share a common time zone offset (so I can send them an email at a particular time everyday), and can not figure it out!
How do I get a list of the time zone names for a particular offset? I've been tinkering with TzInfo and ActiveSupport::TimeZone.zones_map with limited success.
Am I taking the wrong approach here? I was thinking I could store the GMT offset on the user instead, and query that way?
Word of warning
When using the active_model_serializers gem make sure you override the options in the app controller as this gem will override all JSON rendering not just the ActiveModel you're looking to serialise. So use something like:
ruby
defdefault_serializer_options
{ root:false }
end
Without the above you will have a root node in all of your JSON rendering possibly breaking various client side javascript apps and WebService clients that consume the JSON.
I have incorporated CanCan (another mega thanks, btw!), but this link doesn't work. The user not set when it is passed this way, so cancan authorization fails. I can get around it by using a form and submit instead of the link... but i feel like i'm missing something???
Metrical is not maintained anymore, see this commit. According to Readme, it may still work when installed with Bundler and run with bundle exec. Revived MetricFu works like a charm, however I had to add it to Gemfile gem 'metric_fu', group: :metrics, require: false and run with bundle exec too. ruby_parser could not be found otherwise.
I was able to "fix" the problem when editing an existing product and not having the second select or having it with all the options. It's looking pretty nasty but it works.
Jobby (https://github.com/Spakman/jobby) is useful for running multiple daemons under a shared environment. Allows you to spin off new processes without reloading entire rails env each time.
In fact, because Rails prefers JSON be root wrapped, you need to use this library if you want to have a nice clean controller like Ryan's without heavily customizing ngResource.
If you have problems with url helpers while running zeus, I could be wrong but believe it's because of this here.
I applaud that effort to optimize time, but like spork, I've kicked zeus to the curb. They make the test environment just a little too dissimilar from the production and development environments. I wind up spending a lot of time tracking down bugs in my code... or my tests... only to learn it's neither; it's my testing environment flaking out. So how much time is it really saving? (BIG fan of guard, though.)
YMMV
They changed the string array to a PathSet class in Rails 3.2.
To see it as a string array, <%= controller.view_paths.map &:to_path %>
It looks like the deprecation was an empty threat because it's there in 3.2:
http://apidock.com/rails/v3.2.13/AbstractController/ViewPaths/ClassMethods/prepend_view_path
is there a way to use this with the acts_as_commentable gem?
Hello. I have a problem. This app use sqlite3, but i need postgresql. I edit my Gemfile and database.yml. My app work in rails server, but on heroku doesn't. May be it's needs to edit something other. Write me please, what i needs to edit to use postgersql.
Brilliant screencast. I expected some basics but you even went as far as developing jQuery plugins. And you show common pitfalls. Thanks so much.
Same problem here. If I run "cap deploy" after a failed "cap rubber:create_staging" deployment I'll get the following error:
** [out :: production.blog.com] rake aborted!
** [out :: production.blog.com] could not connect to server: Connection refused
** [out :: production.blog.com] Is the server running on host "production.blog.com" (10.210.xxx.xx) and accepting
** [out :: production.blog.com] TCP/IP connections on port 5432?
Any other ideas how to fix this Mongo::ConnectionFailure? The last time I deployed (4-5 months ago everything worked like a charm). Updated to latest rubber version.
Hi Ryan,
Thanks for the frontend framework episodes!
In the EmberJs app there was one feature not included in the AngularJs app - disabling the button if all entries are winners.
I implemented that in Angular easily by using ng-disabled="allWinners()" on the button and controller code
however I noticed that it was being called a lot (4 times on load and everytime a character is entered in the textbox).
Is there a way in Angular to only call a bound function when a property is updated, much like Ember does?
Awesome railscast!
I've been dealing with this problem a lot lately while building a multi-tenancy app. Corey Haines' view on TDD is very interesting, and I encourage anyone interested to check out his brand new screencast episodes on Clean Coders.
Please open an issue on zeus on github
Great railscast!
Only one problem with zeus and guard:
When we are using it, randomized with seed is always 0. Any solutions/suggestions? Is not a very big deal nonetheless.
Would have liked to see this cast for Test::Unit too... ;-)
Thank you! That was a very helpful comment. Ryan should add it to the ASCII cast too
Ryan, FactoryGirl.build implictly creates records in database when it has associations. Maybe it's better to use just Model.new for things like validations instead of build()?
This is great ! Thank you, I was looking for that.
Been finding the solution online for a while. Most of them give the adding the if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi which is a must have.
Even after adding this line , rails still errors. I have to remove .rvm association from export path like you mention here. Solved!
As of MiniTest 4.2.0 you can run tests in parallel with
parallelize_me
.I am follow this video and get this error
I tried your source, still this error, I am use openSUSE12.3 and installed nodejs, any thing else I miss?
Just thought I'd mention that !! works in bash, but it doesn't auto-expand like that. I wasn't aware of it... hopefully I don't forget before I have occasion to use it.
Wooohoo!!!
yeah .the speed of test is very important for TDD.. personally i find Spork + sublime Text2 Rspec bundle is really helpful and significantly fast!
Rouge is great gem for syntax highlighting and it's written in pure Ruby. I've written blog post with simple Rouge configuration with Redcarpet in Ruby on Rails.
Syntax highlighting in Ruby on Rails
to solve this issue, I add "config.serve_static_assets = false" to my config/environments/development.rb
+1
thank you very much! 2 days without sleep and so easy solve of this problem :3
Quick and dirty way to even add new tags on the fly.
Maybe a better way is to just change the behavior on the client side?
figured it out:
Missing this!
Got this from the source.
To be honest, to make APIs rails is not the best options, I prefer to use goliath, https://github.com/postrank-labs/goliath
checkout the performance test (http://jgwmaxwell.com/accelerating-ruby-apis/ ):
Rails 531 request/s
Sinatra 576 request/s
Sinatra::Synchrony 1692 request/s
Goliath 1924 request/s
Cramp 3516 request/s
node.js 3100 request/s
at 8:07.. How would I return more than just the name of the object?
I need to supply several other attributes as well although I'm having a hard time finding a simple explanation for using .map to return other attributes as well.
Yes. Also if you delete a product_field from the product_type, the data remains.
This is nice if you've got a store that you or a couple of people manage, but wouldn't really cut it for anything larger than that.
How to use Handlebars instead of eco in rails ?
I am trying to query all of the Users that share a common time zone offset (so I can send them an email at a particular time everyday), and can not figure it out!
User.where(:time_zone => ['list','of time','zone names'])
How do I get a list of the time zone names for a particular offset? I've been tinkering with TzInfo and ActiveSupport::TimeZone.zones_map with limited success.
Am I taking the wrong approach here? I was thinking I could store the GMT offset on the user instead, and query that way?
My google-fu has let me down on this one.
Wondering how could this be implemented using ActiveAdmin or Rails Admin.
Thanks Ryan for another great episode :)
Word of warning
When using the
active_model_serializers
gem make sure you override the options in the app controller as this gem will override all JSON rendering not just the ActiveModel you're looking to serialise. So use something like:Without the above you will have a root node in all of your JSON rendering possibly breaking various client side javascript apps and WebService clients that consume the JSON.
Thanks from me too! I wasn't close to finding a solution for this issue until I read your comment.
words cannot explain how useful I have found this episode!
I've restructured my first rails site to work this way.
I hit a snag that's bugging me.
For example, in this file:
https://github.com/railscasts/136-jquery-ajax-revised/blob/master/checklist-after/app/views/tasks/_task.html.erb
The delete action is fired with this link:
<%= link_to "(remove)", task, method: :delete, data: {confirm: "Are you sure?"}, remote: true %>
I have incorporated CanCan (another mega thanks, btw!), but this link doesn't work. The user not set when it is passed this way, so cancan authorization fails. I can get around it by using a form and submit instead of the link... but i feel like i'm missing something???
I posted my question here, but thought I'd go straight to the masters for this one...
http://stackoverflow.com/questions/15815522/ruby-on-rails-cancan-user-is-nil-during-destroy-action
Or you can use localtunnel. See http://progrium.com/localtunnel/. It works like a charm.
Thanks ! Just used it today and the gem found a good optimization !
Metrical is not maintained anymore, see this commit. According to Readme, it may still work when installed with Bundler and run with
bundle exec
. Revived MetricFu works like a charm, however I had to add it to Gemfilegem 'metric_fu', group: :metrics, require: false
and run withbundle exec
too.ruby_parser
could not be found otherwise.I was able to "fix" the problem when editing an existing product and not having the second select or having it with all the options. It's looking pretty nasty but it works.
The only problem is that when you show the second select, it shows all the options and not only the one it was supposed to.
Jobby (https://github.com/Spakman/jobby) is useful for running multiple daemons under a shared environment. Allows you to spin off new processes without reloading entire rails env each time.
Thanks for the reply! I didn't notice your solution until now.
+1
+1
Thanks, BTW :vote is an action, yours might be different.
Disregard this, I had defined fields_for in a custom form builder and it was overriding the default implementation.
In fact, because Rails prefers JSON be root wrapped, you need to use this library if you want to have a nice clean controller like Ryan's without heavily customizing ngResource.
EDIT: figured out that it's coming from the arguments passed to fields_for here:
why doesn't fields_for accept more than one argument?