If you want to read the jquery-ui code, you won't find the 'ui-state-*' classes in jquery.ui.autocomplete.js; you'll need to look in jquery.ui.menu.js.
I am getting a ArgumentError wrong number of arguments (3 for 1), when I call the link_to_add_fields helper method. I've placed it outside of the block for fields_for, like so:
"SELECT \"users\".* FROM \"users\" LEFT OUTER JOIN \"profiles\" ON \"profiles\".\"user_id\" = \"users\".\"id\" WHERE (((\"profiles\".\"last_name\" ILIKE '%jane%' OR \"profiles\".\"last_name\" ILIKE '%doe%') OR (\"profiles\".\"first_name\" ILIKE '%jane%' OR \"profiles\".\"first_name\" ILIKE '%doe%')))"
which returns the expected results... But how to implement this request in my search form (in my view) and/or in my controller ?
"SELECT \"users\".* FROM \"users\" LEFT OUTER JOIN \"profiles\" ON \"profiles\".\"user_id\" = \"users\".\"id\" WHERE (((\"profiles\".\"last_name\" ILIKE '%jane doe%') OR (\"profiles\".\"first_name\" ILIKE '%jane doe%')))"
but how to implement the split(' ') to have the expected SQL ?
Any help (and a bit of explanation) would be great, documentation is a bit light on the subject...
Cheers
In Rails 4 beta1, I'm getting a "HTTP/1.1 422 Unprocessable Entity" error when attempting a post request to an API. The controller is raising an ActionController::InvalidAuthenticityToken error.
Do I need to somehow disable request forgery protection for APIs?
Great screencast as always. Have you checked out https://github.com/nviennot/irb-config yet? It allows running tests from within the console as well, but it seems faster than the other tools.
ArgumentError in Active_admin/devise/sessions#new
Showing C:/Ruby193/lib/ruby/gems/1.9.1/gems/activeadmin-0.6.0/app/views/layouts/active_admin_logged_out.html.erb where line #9 raised:
different prefix: "C:/" and "G:/rails_workspace/newWorkspace/myActAdmin/app/assets/stylesheets"
(in G:/rails_workspace/newWorkspace/myActAdmin/app/assets/stylesheets/active_admin.css.scss)
These tools have a few issues if you're using vagrant:
They will try to create a socket file on your share, which doesn't support that file type. You can get around this in spring with the SPRING_TMP_PATH, but I don't think zeus has a configuration option for this.
notification fs events don't work, so they need to fallback to fs polling instead.
Bitbucket hosts free private mercurial (hg) and git repositories and the capfile can just be changed to bitbuckets ssh link and it works like a charm. =)
Have been playing around with rubber and using this great tutorial as a guide. Create 3 instances and forgot about them for some weeks... BANG, amazon send me a whopping bill of $168.
Play around with the t1.micro instance and not the instances that are being played around with in the rails cast!
If anyone gets an error about Undefined method `[]' for nil:NilClass this is because of this line: self.email = omniauth['user_info']['email'] if email.blank?
Due to some update this part should be changed 'user_info' to 'info', so self.email = omniauth['info']['email'] email.blank? or self.email = omniauth.info.email email.blank?
Thanks for the explanation. I'm wondering though, how would you go about doing this if you're deploying to Heroku where it seems that you can't add or edit anything in the deployed application. I read that it's basically read only because any changes you make to any file are temporary and will be undone whenever you push your source code to Heroku.
I couldn't get cropping to work with mini magick, but after trying some different things I still managed. Seems like someone has switched around on (X, Y) and (W, H).
This should work:
def crop
manipulate! do |img|
img.crop "#{model.width}x#{model.height}+#{model.x}+#{model.y}"
img
end
end
Sadly, neither zeus or commands work under JRuby. This is because JRuby does not support Kernel#fork.
commands does work for running generate, and rake commands will also start quickly. rake 'test' also runs, but although it starts quickly, I believe it starts a separate process for the sub-tasks test:unit and test:functional.
post published is very helpfull for me.Here you have carried out on single model.How to implement it for example like if User model has many association with Address model.I want user information in one form and Address information in Another form.Please explain me
If you're a TMUX user I've found the Tmuxinator Gem to be fantastic way to setup and control multiple Rails dev environments.
Starting and/or attaching to an app's session is as simple as $ mux my_app; Adding Zues or Spring into the into Tmuxinator config is something I might try in order to further automate my dev environments.
If you frequently work on only 1 or 2 projects then you might not get a lot of milage out of TMUX. However, if you're like me -- I have 9 rails apps that I'm constantly switching between -- then it can make your life a lot easier.
Charles is right! For more information, see the "Interaction States" section at http://docs.jquery.com/UI/Theming/API
If you want to read the jquery-ui code, you won't find the 'ui-state-*' classes in
jquery.ui.autocomplete.js
; you'll need to look injquery.ui.menu.js
.I am getting a ArgumentError wrong number of arguments (3 for 1), when I call the link_to_add_fields helper method. I've placed it outside of the block for fields_for, like so:
I'm using rails 4.0 beta. Anyone have any idea why this could be happening?
I ran into the same issue, I posted a solution at http://stackoverflow.com/a/15865006/1814446
Another solution is GoGo, it creates a pseudo-shell with the Rails environment preloaded. https://github.com/brianhempel/gogo
Sounds similar to https://github.com/jugyo/rails-sh
Hello
Need some help on this
I wiould like to do something like that :
the SQL generated is the following
"SELECT \"users\".* FROM \"users\" LEFT OUTER JOIN \"profiles\" ON \"profiles\".\"user_id\" = \"users\".\"id\" WHERE (((\"profiles\".\"last_name\" ILIKE '%jane%' OR \"profiles\".\"last_name\" ILIKE '%doe%') OR (\"profiles\".\"first_name\" ILIKE '%jane%' OR \"profiles\".\"first_name\" ILIKE '%doe%')))"
which returns the expected results... But how to implement this request in my search form (in my view) and/or in my controller ?
My search form is :
As it is the SQL returned is
"SELECT \"users\".* FROM \"users\" LEFT OUTER JOIN \"profiles\" ON \"profiles\".\"user_id\" = \"users\".\"id\" WHERE (((\"profiles\".\"last_name\" ILIKE '%jane doe%') OR (\"profiles\".\"first_name\" ILIKE '%jane doe%')))"
but how to implement the split(' ') to have the expected SQL ?
Any help (and a bit of explanation) would be great, documentation is a bit light on the subject...
Cheers
Using POW (and this example blog app) I got it working by setting Twitter callback url to....
http://blog-after.dev/auth/twitter/callback
Hi everyone, I had a problem with my Nested Model From, I am not sure what did I do wrong,
When I try to render the from, the nested form field does not appear. Is there any problem with my codes ?
No, cap deploy doesn't flush the db when you redeploy.
Suggest setting up a $5 per month instance on www.digitalocean.com and creating a test application so you can experiment.
As of time of posting, 7th April 2012 ,tutorial still works fantastically on Ubuntu 12.10.
A few updates:
Delete the line in /etc/nginx/sites-enabled/default if you get the error bind() to [::]:80 failed (98: Address already in use)
listen [::]:80 default_server
If using 12.10 or 12.04 use
rbenv bootstrap-ubuntu-12-04
Postgres can still be installed using the method noted in the tutorial, but it's being depreciated in lieu of:
https://wiki.postgresql.org/wiki/Apt
thanks!
+1 Thanks!
I am also trying to work out how to use hstore with a multi tenant app. Any help would be appreciated!
Found the answer in the Edge Docs here: http://edgeapi.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html#method-i-protect_against_forgery-3F
...others might benefit if this is included in the show notes.
In Rails 4 beta1, I'm getting a "HTTP/1.1 422 Unprocessable Entity" error when attempting a post request to an API. The controller is raising an ActionController::InvalidAuthenticityToken error.
Do I need to somehow disable request forgery protection for APIs?
I'm having some trouble getting the sample to run. I downloaded the source and ran
When I navigate to localhost:3000 in Chrome the list of names doesn't appear. What am I missing?
Ryan,
Great screencast as always. Have you checked out https://github.com/nviennot/irb-config yet? It allows running tests from within the console as well, but it seems faster than the other tools.
+1
Commands works fine with Jruby, I use it.
please provide solution as early as possible
ArgumentError in Active_admin/devise/sessions#new
Showing C:/Ruby193/lib/ruby/gems/1.9.1/gems/activeadmin-0.6.0/app/views/layouts/active_admin_logged_out.html.erb where line #9 raised:
different prefix: "C:/" and "G:/rails_workspace/newWorkspace/myActAdmin/app/assets/stylesheets"
(in G:/rails_workspace/newWorkspace/myActAdmin/app/assets/stylesheets/active_admin.css.scss)
These tools have a few issues if you're using vagrant:
SPRING_TMP_PATH
, but I don't think zeus has a configuration option for this.I tried to change DB from sqlite3 to mysql2, but I got the next error:
ActiveRecord::RecordNotFound in UsersController#new
Couldn't find User with id=1
Rails.root: /home/epuente/proyectos/ruby/auth
Application Trace | Framework Trace | Full Trace
app/controllers/application_controller.rb:7:in
current_user'
_app_views_layouts_application_html_erb__11355537_84799900'app/views/layouts/application.html.erb:11:in
Is there any idea how to solve this?
Hi Ryan since you embedded faye gem, wouldn't be nice to embed this too? faye-rails
great gem by the way!
bye ;)
Bitbucket hosts free private mercurial (hg) and git repositories and the capfile can just be changed to bitbuckets ssh link and it works like a charm. =)
+1 for a redo of this episode showing API versioning and OAuth2. If you're focusing on providing an API, the view stuff is orthogonal.
Also, some context on perf would be very useful here.
Anyone else having a problem when running cap deploy:setup and getting a chmod error :
failed: "sh -c 'chmod g+w /home/deployer/apps/blog /home/deployer/apps/blog/releases /home/deployer/apps/memDownDash/shared /home/deployer/apps/blog/shared/system /home/deployer/apps/blog/shared/log /home/deployer/apps/blog/shared/pids'" on 192.168.119.131
chmod:
"changing permissions of `/home/deployer/apps/blog/releases'
** [out :: 192.168.119.131] : Operation not permitted"
chmod:** [out :: 192.168.119.131] changing permissions of `/home/deployer/apps/blog'
** [out :: 192.168.119.131] : Operation not permitted
chmod:
** [out :: 192.168.119.131] changing permissions of `/home/deployer/apps/xxx/shared'
** [out :: 192.168.119.131] : Operation not permitted
chmod:
** [out :: 192.168.119.131] changing permissions of `/home/deployer/apps/blog/shared/system'
** [out :: 192.168.119.131] : Operation not permitted
chmod: changing permissions of `/home/deployer/apps/blog/shared/log': Operation not permitted
chmod: changing permissions of `/home/deployer/apps/blog/shared/pids': Operation not permitted
I setup a user in the admin group, and have "set :use_sudo, false"
Are there any gem that speeds up rspec/capybara testing under Windows (besides Spork)?
time rake db:migrate with normal macbook pro hdd: 2.x seconds
time rake db:migrate with samsung 840 pro ssd: 1.x seconds
I also feel the difference :)
A little warning.
Have been playing around with rubber and using this great tutorial as a guide. Create 3 instances and forgot about them for some weeks... BANG, amazon send me a whopping bill of $168.
Play around with the t1.micro instance and not the instances that are being played around with in the rails cast!
no evidence, but when I made the switch, I really felt the difference !
If anyone gets an error about Undefined method `[]' for nil:NilClass this is because of this line: self.email = omniauth['user_info']['email'] if email.blank?
Due to some update this part should be changed 'user_info' to 'info', so self.email = omniauth['info']['email'] email.blank? or self.email = omniauth.info.email email.blank?
Thanks for the explanation. I'm wondering though, how would you go about doing this if you're deploying to Heroku where it seems that you can't add or edit anything in the deployed application. I read that it's basically read only because any changes you make to any file are temporary and will be undone whenever you push your source code to Heroku.
Thank you, that info was very useful!
I couldn't get cropping to work with mini magick, but after trying some different things I still managed. Seems like someone has switched around on (X, Y) and (W, H).
This should work:
+1 This is working for me.
For JRuby, you can use JRuby's bundled Nailgun server as an alternative to Spork. It'll be very familiar if you've ever run RSpec with a DRB server: http://blog.headius.com/2009/05/jruby-nailgun-support-in-130.html
Great suggestion - did not know about this. You can also change the settings to use spring, by just prepending the rspec command with it...
Thanks - good tips. So far I've been using "spin, combined with the kicker gem for autotests:
https://github.com/jstorimer/spin
Seems though Zeus and Spring are even easier to use.
If you want to run tests from within Sublime Text, check out the RubyTest package. The README has instruction on configuring it for Zeus.
Sadly, neither zeus or commands work under JRuby. This is because JRuby does not support Kernel#fork.
commands does work for running generate, and rake commands will also start quickly. rake 'test' also runs, but although it starts quickly, I believe it starts a separate process for the sub-tasks test:unit and test:functional.
Hi
post published is very helpfull for me.Here you have carried out on single model.How to implement it for example like if User model has many association with Address model.I want user information in one form and Address information in Another form.Please explain me
If you're a TMUX user I've found the Tmuxinator Gem to be fantastic way to setup and control multiple Rails dev environments.
Starting and/or attaching to an app's session is as simple as
$ mux my_app
; Adding Zues or Spring into the into Tmuxinator config is something I might try in order to further automate my dev environments.If you frequently work on only 1 or 2 projects then you might not get a lot of milage out of TMUX. However, if you're like me -- I have 9 rails apps that I'm constantly switching between -- then it can make your life a lot easier.
Happy coding all :)
Do you have some evidence for this?
Beyond the first run, the files should be paged into RAM anyway, so I would expect CPU to be the bottleneck, rather than disk.
(SSDs are great of course, I'm just not sure that it helps in this case).
Consider https://github.com/jugyo/rails-sh - works amazingly!
+1
Hmm, I'm not able to find turbo patch for ruby 2.0, are you sure about that ?
If you would like to use zeus, guard and parallel tests together check out https://github.com/sevos/zeus-parallel_tests
Take a look at https://github.com/qnm/guard-zeus for Guard integration.
With rvm, startups also much faster when optimization patches are used, for example ruby-1.9.3-p392-
railsexpress
or ruby-2.0.0-p0-turbo
.One tip to fasten Rails' startup : buy a SSD drive ! It will make your life easier ;)
Will this make tests in autotest or guard faster?