We'd probably see a more significant improvement in performance if your action wasn't shelling out. eg. if you just ran some ruby code or returned the contents of a file instead of starting a sub-shell to get the process list.
Do you think you could explain how this might work with nested objects. My images belong to a subsidiary object and I can't figure out how to crop them.
@Alexander Zubkov, thanks a lot for posting your module! I tried it out and it works! My preference though, is not for max+1 but max of a particular set +1. So I used your module as inspiration, but ended up doing this manually as follows.
This works just as I want, but I wonder if there's a way to make this into a module! You'd have to be able to tell the callback method (set_position) which column (in this case "edition_id") to use in the where clause. I'm too new to RoR to be able to figure this out. Any suggestions?
You mentioned the config.log_tags .. Are these only params passed in via the 'params' hash? I wanted to include in there the method that is being used to output the data to the logger.
For example, if I had a model called 'Foo', I would want the logger to print out "[Foo] blah blah blah".
Is this possible, and if so, do you know where the docs are or how I can do this?
I recently released a gem which simplifies the whole process of creating site-wide announcement messages. It is called announcements, you can check it out at github:
classApplicationController < ActionController::Basedefauthenticate!case request.format
whenMime::XML, Mime::JSON# use http_basic_authenticationelse# use form_based_authenticationendend#...end
Nice screencast again @Ryan! Maybe I'm late on this but when did the ruby hash MyModel.new(:test => "test1") turn into MyModel.new(test: "test1") . Obviously the latter is more readable/user friendly :)
I have tested this advanced search method for my application and it's working fine.
My question is how can i implement field calculation in that model?
Example for products models showing here, if i need to have "totals of products selected", "total product's cost" and "average cost", where can i put these calculation methods?
It's worth noting that older versions of RubyGems will report an invalid gemspec for rails 3.2.0. You can upgrade RubyGems to address this (gem update --system) or you can wait for 3.2.1, which will fix this. Details here.
And in my /app/views/index.erb
<%= subscribe_to "/notification" %>
My understanding was this should publish to the /notifications and push the alert out, but that isn't the case. What am I missing here? Thx for the great gem
Very useful screencast about upgrading, actually I've tried to do that few days ago and got stuck on dependencies, but I will try again. Thanks a lot!
The solution I did, was removing Gemfile.lock and running bundle install again. But I don't think this is good approach to achieve new version of rails.
But I want to know how we can build relavant search engine?
Ex: If we are searching for keyword "beer" if there is not results for the keyword beer it should atleast return relavant results such as "Alcohol","Whisky".
Another Example would be Keyword "mobile phones" it should return results as "Nokia", "Samsung" and so on.
But I want to know how we can build relavant search engine?
Ex: If we are searching for keyword "beer" if there is not results for the keyword beer it should atleast return relavant results such as "Alcohol","Whisky".
Another Example would be Keyword "mobile phones" it should return results as "Nokia", "Samsung" and so on.
Can you actually explain what this does (are you copying or symlink?) and why (why separate directory since rails has a place for everything?)? From a beginner experience deploying rails app seems complex. Thanks.
Thank you Ryan for this episode. Has anyone used jcrop and carrierwave to mimic how Facbook's does thumbnail . That would be a cool episode maybe a revision of this cast. ;)
Is it possible to forward a cookie from the user browsing my site, trough ActiveResource? So that the site in self.site receives the cookie from my user?
I have the same problem with Rails 3.1.3
You don't need to remove the Gemfile.lock, just use
bundle update
. http://gembundler.com/man/bundle-update.1.htmlWe'd probably see a more significant improvement in performance if your action wasn't shelling out. eg. if you just ran some ruby code or returned the contents of a file instead of starting a sub-shell to get the process list.
Thanks for the screencast!
Hello every body,
this command line doesn't run any more
i have this error
Invalid application name rails, constant Rails is already in use. Please choose another application name.
what is the solution ?
Tx a lot
G
+1
Great idea and well presented as usual Ryan...
Title was a little misleading though :/
Thanks Ryan. Your videos are amazing! I also published my first gem called API Key Maker. Check it out at RubyGems.org.
Is the following change justifiable?
from:
to:
Ref: http://rhnh.net/2010/06/30/acts-as-list-will-break-in-production
Has anyone had issues in production on Heroku with compass 0.12.alpha?
https://github.com/chriseppstein/compass/issues/654#issuecomment-3661444
Good episode!
Do you think you could explain how this might work with nested objects. My images belong to a subsidiary object and I can't figure out how to crop them.
Can you help?
I never knew that you could use underscore (_) to retrieve the last returned value in the console. Nice trick! (See the video around 2:23).
http://rubyquicktips.com/post/342527837/console-tip-retrieve-the-last-return-value-with
humm, not sure about default, what if just choose one!
@Alexander Zubkov, thanks a lot for posting your module! I tried it out and it works! My preference though, is not for
max+1
butmax of a particular set +1
. So I used your module as inspiration, but ended up doing this manually as follows.This works just as I want, but I wonder if there's a way to make this into a module! You'd have to be able to tell the callback method (set_position) which column (in this case "edition_id") to use in the
where
clause. I'm too new to RoR to be able to figure this out. Any suggestions?Thanks for this.
small update, i dont think one needs to store the OpenID information anymore.
Mine just worked fine this way.
You mentioned the config.log_tags .. Are these only params passed in via the 'params' hash? I wanted to include in there the method that is being used to output the data to the logger.
For example, if I had a model called 'Foo', I would want the logger to print out "[Foo] blah blah blah".
Is this possible, and if so, do you know where the docs are or how I can do this?
Thanks for the awesome screencast (as always).
I recently released a gem which simplifies the whole process of creating site-wide announcement messages. It is called
announcements
, you can check it out at github:https://github.com/svileng/announcements
I hope you'll find that useful.
Ok so I have found that out:
What if I`m using :uuid as POST parameter? Is it going to work?
do you know if this works in rails 3.0.3?
Had to add the psych gem to my gemfile to get rails 3.2 working with one of my apps for some reason...
It's pretty important to note that HTTP streaming doesn't work with HAML: https://github.com/nex3/haml/issues/436
http://stackoverflow.com/questions/7701113/rack-error-racklintlinterror-response-body-must-respond-to-each
ruby 1.9 thats why lol . Sorry, had to research it on my own :)
I would also love to see a video on this.
Nice screencast again @Ryan! Maybe I'm late on this but when did the ruby hash MyModel.new(:test => "test1") turn into MyModel.new(test: "test1") . Obviously the latter is more readable/user friendly :)
Much thanks to those of you who found the imagemagick ruby 1.9.2 conflict and posted an answer here. Used:
brew install -f imagemagick --disable-openmp
and everything is happen again...
This is fine actually. So you should not worry about it too much.
I have tested this advanced search method for my application and it's working fine.
My question is how can i implement field calculation in that model?
Example for products models showing here, if i need to have "totals of products selected", "total product's cost" and "average cost", where can i put these calculation methods?
I for one would be interested in learning how to handle inbound faxes. :-)
Indeed, Rails 3.2 requires rubygems 1.8.15. But JDBC adapters are broken w/ Rails 3.2, see https://github.com/jruby/activerecord-jdbc-adapter/issues/132
If you use JRuby, you'd better keep Rails 3.1 for now
It's worth noting that older versions of RubyGems will report an invalid gemspec for rails 3.2.0. You can upgrade RubyGems to address this (
gem update --system
) or you can wait for 3.2.1, which will fix this. Details here.awesome episode. one very minor nitpick..
When you did:
diff development-middleware.txt production-middleware.txt
you could have done:
diff <(rake middleware) <(RAILS_ENV=production rake middleware)
sub shells have all sorts of uses.
It does work!
Just bundle update and make sure you use the git branch as your source:
gem 'mercury-rails', :git => 'git://github.com/jejacks0n/mercury.git'
If you have problems see this github issue:
https://github.com/jejacks0n/mercury/issues/114
Publish_to from a controller doesn't seem to work ( States in manual this is possible ) or I misred or I did something wrong.
Say I have
IndexController#Index
PrivatePub.publish_to("/notification", "alert('blablabalabl');")
And in my /app/views/index.erb
<%= subscribe_to "/notification" %>
My understanding was this should publish to the /notifications and push the alert out, but that isn't the case. What am I missing here? Thx for the great gem
it doesn't work with mercury-rails yet, any suggestions ?
Very useful screencast about upgrading, actually I've tried to do that few days ago and got stuck on dependencies, but I will try again. Thanks a lot!
The solution I did, was removing Gemfile.lock and running bundle install again. But I don't think this is good approach to achieve new version of rails.
Great Tutorial.
But I want to know how we can build relavant search engine?
Ex: If we are searching for keyword "beer" if there is not results for the keyword beer it should atleast return relavant results such as "Alcohol","Whisky".
Another Example would be Keyword "mobile phones" it should return results as "Nokia", "Samsung" and so on.
Great Tutorial.
But I want to know how we can build relavant search engine?
Ex: If we are searching for keyword "beer" if there is not results for the keyword beer it should atleast return relavant results such as "Alcohol","Whisky".
Another Example would be Keyword "mobile phones" it should return results as "Nokia", "Samsung" and so on.
This episode could sure use an update.
See this page about performance impacts of adding attaching a handler to window scroll: http://ejohn.org/blog/learning-from-twitter/
Thanks Ryan!
3.2 Tip. You should replace
if template.locals.include? :mustache
with
if template.locals.include? 'mustache'
Thanks for the amazing material. At $10 a month this is the most valuable development resource I've come across.
If anyone is having trouble getting the checkboxes to save make sure you make your assocation_ids accessible.
Can you actually explain what this does (are you copying or symlink?) and why (why separate directory since rails has a place for everything?)? From a beginner experience deploying rails app seems complex. Thanks.
Thank you Ryan for this episode. Has anyone used jcrop and carrierwave to mimic how Facbook's does thumbnail . That would be a cool episode maybe a revision of this cast. ;)
Hey,
Can I implement Devise in an existing model of an existing application.
I have a Attendee Model with a couple of fields: Name , Email.
Can I use devise for this existing Model ?
Hi There!
Is it possible to forward a cookie from the user browsing my site, trough ActiveResource? So that the site in self.site receives the cookie from my user?
Regards,
Nadeem
All good, just done what I should do before posting anything...google search.
Found that you can add the option :path => movie_movie_titles_path to the inputs
Thanks!
Thanks for the awesome tutorial, just got a bit stuck though.
I am up to the stage of amending my show.html.erb, but when I try reloading the page I am getting...
undefined method `movie_title_path' for #<#Class:0xa16fea4:0xa434a2c>
I am using nested resources which gives me the url /movie/movie_titles/6.
Is there something I am missing?
Thanks!!!
Would it be better if before running the migration you add an index for friend_id on the friendships table?