Even if the JS and CSS is cached, the browser won't start parsing and interpret until your page shows the inclusion. If your page takes 10 seconds to load, that will take 10 seconds. If are using streaming, that happens right away.
I thought the idea of streaming wasn't to show the user a part of the page, but to have the browser start parsing and interpreting CSS and JavaScript while the server is still running that complex and heavy query.
Yeah, I'm getting the same. It means that we have no enable streaming per action with an explicit call. Looks ugly, I wonder if streaming is regarded as an exception.
hi,
i always get into problems testing the content of emails send with delayed_job. it should be pretty common to do so right ? haven't found any good solution for that... tips ?
why does that not work:
ruby
it "emails user when requesting password reset"do
...
Delayed::Worker.new.work_off
last_email.to.should include(user.email)
end
If you're using Guard you can also use the guard-process gem. It doesn't have all of the features Foreman has, but it does allow you to easily specify when your processes need to be restarted in standard Guard fashion.
I have Foreman set up for Heroku, but didn't think of using it in my development environment. Is there a way to see the usual rails server logs? That's the only thing keeping me from switching my s alias from rails server to foreman start. Any ideas?
cldwalker is probably opinionated about Ripl, but I'll ask if he'll accept a patch to Hirb for built-in Pry support.
Edit: Just found this issue where he indeed says he doesn't want to support more shells in the gem itself (and you guys originally shared this .pryrc snippet =]).
Thank you! I took Pry for a spin several weeks ago but didn't take the time to fully explore getting Hirb working so I haven't been using it for Rails' console. I think I will now :-)
How can I render nested partial with this plugin. Only partial property_manager_fields is rending but nested partial login_fields is not being rending with click on add_to_link using jQuery
_form.html.erb
<%= f.fields_for :property_managers do |builder| %>
<%= render "property_manager_fields", :f => builder %>
<% end %>
_property_manager_fields.html.erb
<%= f.fields_for :login do |builder| %>
<%= render "login_fields", :f => builder %>
<% end %>
<%= f.text_field :phone %>
<%= link_to_remove_fields "remove", f %>
Today I needed to implement role-based authorization. I reviewed a few gems, and the cancan gem looked like the easiest to implement (and it had the most downloads and most forks on github).
It was a true pleasure to integrate this into my app! Works like a charm. Simple, and effective.
Now I need to remove the old half-finished, hard-coded authorization logic, and that may actually be more work!
Thanks Ryan, love your screencasts. This gem was so easy to use, I didn't even bother watching the screencast :-)
The biggest obstacle with setting up Sunspot in a production environment was just setting it up with a process monitor, like monit. I recently submitted a patch for Sunspot so that you can set the directory for the PID file, and it was accepted, so there's really nothing left to stop you from using 'rake sunspot:solr:start' as a startup task.
Another thing i would like to do would be to bring ruby-debug commands into Pry itself, rather than having to use Pry from inside ruby-debug. This will be a task for the future (but should not be too difficult).
I use binding.pry to break the app (start webrick with --debugger) but couldn't find how to step or next at the Pry prompt, though I can 'exit' to let the app continue. Is there anyway to have Pry work with ruby-debug?
This is true for me as well. Everytime Ryan is executing tests they run 4 times faster than with my computer. I know that you can speed up tests with spork, but Ryan doesn't do it in his episode and he gets 4 times faster results:
With the repo of this episode the tests run in 2 seconds on my pc.
On Ryans PC they run in 0.5 seconds or less
Hey Ryan, I have been trying to see if there is a way to somehow integrate cancan's ability model into this Sunspot search. Any thoughts on how it might be done?
It should mostly work fine in 1.8.7 MRI and 1.8.7 RBX; i even backported Proc#source_location and Method#source_location so show-method and show-doc should work too, the only thing that doesnt work in 1.8.7 is source retrieval of methods defined inside the REPL; but it should be relatively rare you'd do this (i hope) :)
After editing the file in vim and exiting type load _file_ or reload-method Your#method_name to manually reload the file. (where _file_ is a special local representing the last file accessed by Pry)
Dont forget to mention that you need to install memcached in your system. It wasnt obvious to me and nothing worked until I ran
apt-get install memcached
@adnan4721 you should start Faye using Thin (as a separate process). You'll find a Rackup example for that on the Faye site: http://faye.jcoglan.com/ruby.html
Put your config into faye_config.ru and start it with the following command:
thin -R faye_config.ru start
Asset pipeline is awesome, but how to deal with scripts like lightbox or wysiwyg, that distributed in one folder with local paths for included js, css and images? How to deal with this via asset pipeline?
hi,
I was having some issues thought i might share it here.
I am working on a rails3.1.0.rc6 app using the latest Omniauth gem to authentication user by tiwtter and facebook
But like the demo here on
ruby
defcreate
render :text=>request.env['omniauth.auth'].to_yaml
end
is giving null response
but changing it to
ruby
defcreate(auth=request.env['omniauth.auth'])
render :text=>auth.to_yaml
end
seems to work fine.
I am not sure why this is happening
If i try
IRB = Pry
I get this:
ruby-1.8.7-p334/lib/ruby/1.8/irb/workspace.rb:19:in initialize': undefined methodconf' for Pry:Class (NoMethodError)
from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb/context.rb:27:in new'
from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb/context.rb:27:ininitialize'
from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb.rb:100:in new'
from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb.rb:100:ininitialize'
from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb.rb:59:in new'
from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb.rb:59:instart'
from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/bin/irb:17
Even if the JS and CSS is cached, the browser won't start parsing and interpret until your page shows the inclusion. If your page takes 10 seconds to load, that will take 10 seconds. If are using streaming, that happens right away.
To that, have a part of the page update with status, you'd use ajax and polling on HTML 4 and sockets on HTML 5 (comet?). Rails is not good at it.
I thought the idea of streaming wasn't to show the user a part of the page, but to have the browser start parsing and interpreting CSS and JavaScript while the server is still running that complex and heavy query.
Yeah, I'm getting the same. It means that we have no enable streaming per action with an explicit call. Looks ugly, I wonder if streaming is regarded as an exception.
When running the curl command I get this error:
Anybody knows what's going on?
hi,
i always get into problems testing the content of emails send with delayed_job. it should be pretty common to do so right ? haven't found any good solution for that... tips ?
why does that not work:
?
Twitter callback URL needs to be set (or else OAuth throws 401 exception): http://goo.gl/EHCqE.
What do you mean? Doesn't
fits your needs?
What is the HTML supposed to look like again?
I'm looking for good rails3 opensource application which use capybara and rspec to write test
http://stackoverflow.com/questions/6392619/looking-for-examples-of-rails-3-integration-acceptance-tests-with-rspec
If you're using Guard you can also use the guard-process gem. It doesn't have all of the features Foreman has, but it does allow you to easily specify when your processes need to be restarted in standard Guard fashion.
How do you think this compares to the terminitor gem...I have been using it to start up my environments.
You probably want to add something like this if you don't want to break xml or json output, (with
responds_to
blocks):Which post that you mentioned here?
I meet the same problem, removed h() and get fixed
But, which file is included first? Which file is implicitly referenceable by "someFile.js" vs explicitly? Alphabetically by directory?
can someone update the commands for Rails 3.1?
I have Foreman set up for Heroku, but didn't think of using it in my development environment. Is there a way to see the usual
rails server
logs? That's the only thing keeping me from switching mys
alias fromrails server
toforeman start
. Any ideas?Hi,
I'd like to clean up the URLs generated by the searches, does anyone know how to do this?
At the moment I'm getting something like this:
http://127.0.0.1:3000/events?utf8=?&search%5Btown_name_equals%5D=&search%5Bgenre_name_equals%5D=DJ+Music&search%5Bdate_equals%5D=&commit=Search
js on Rails 3.1.0.rc6 can't work.why?
I was wondering wouldn't it be easier to just create a rake task (boot.rake)?
You can easily pass the environment type to your commands so you'll be able to use it on production / staging as well.
Short and good intro to foreman. But a bit more explanation on the Procfile itself would have been good for many people i guess.
Because if you know that this is the prefered way to have heroku know about your processes it opens a whole new world ;-)
Here is a good Article about that: http://devcenter.heroku.com/articles/procfile
Has anyone had any success with using the "binding.pry" feature with Pow?
I added a dirty
instance_eval
hack to makeHirb.disable/enable
work in-session:https://gist.github.com/1177892
cldwalker is probably opinionated about Ripl, but I'll ask if he'll accept a patch to Hirb for built-in Pry support.
Edit: Just found this issue where he indeed says he doesn't want to support more shells in the gem itself (and you guys originally shared this
.pryrc
snippet =]).Thank you! I took Pry for a spin several weeks ago but didn't take the time to fully explore getting Hirb working so I haven't been using it for Rails' console. I think I will now :-)
Hi all,
Is it possible to use page caching, but then pull in an entire form via ajax so that it has a fresh authenticity token?
Is that inadvisable for any particular reason?
Thanks,
Raviv
How can I render nested partial with this plugin. Only partial property_manager_fields is rending but nested partial login_fields is not being rending with click on add_to_link using jQuery
_form.html.erb
<%= f.fields_for :property_managers do |builder| %>
<%= render "property_manager_fields", :f => builder %>
<% end %>
_property_manager_fields.html.erb
<%= f.fields_for :login do |builder| %>
<%= render "login_fields", :f => builder %>
<% end %>
<%= f.text_field :phone %>
<%= link_to_remove_fields "remove", f %>
_login_fields.html.erb
<%= f.text_field :username " %>
As per this example How can I add Question with 4 Answers with single click on
Today I needed to implement role-based authorization. I reviewed a few gems, and the cancan gem looked like the easiest to implement (and it had the most downloads and most forks on github).
It was a true pleasure to integrate this into my app! Works like a charm. Simple, and effective.
Now I need to remove the old half-finished, hard-coded authorization logic, and that may actually be more work!
Thanks Ryan, love your screencasts. This gem was so easy to use, I didn't even bother watching the screencast :-)
try the latest master from github, this changeset added generic(Kaminari AND WillPaginate) pagination support:
merge from pull #67
I <3 Kaminari w/ Sunspot.
The biggest obstacle with setting up Sunspot in a production environment was just setting it up with a process monitor, like monit. I recently submitted a patch for Sunspot so that you can set the directory for the PID file, and it was accepted, so there's really nothing left to stop you from using 'rake sunspot:solr:start' as a startup task.
See:Configuring Solr
A few options at present:
https://github.com/AndrewO/ruby-debug-pry
Also you may be interested in:
https://github.com/mon-ouie/pry_debug
Another thing i would like to do would be to bring ruby-debug commands into Pry itself, rather than having to use Pry from inside ruby-debug. This will be a task for the future (but should not be too difficult).
I use
binding.pry
to break the app (start webrick with --debugger) but couldn't find how tostep
ornext
at the Pry prompt, though I can 'exit' to let the app continue. Is there anyway to have Pry work with ruby-debug?This is true for me as well. Everytime Ryan is executing tests they run 4 times faster than with my computer. I know that you can speed up tests with spork, but Ryan doesn't do it in his episode and he gets 4 times faster results:
With the repo of this episode the tests run in 2 seconds on my pc.
On Ryans PC they run in 0.5 seconds or less
Hey Ryan, I have been trying to see if there is a way to somehow integrate cancan's ability model into this Sunspot search. Any thoughts on how it might be done?
Thanks for the great screencast.
For those who wish to use Hirb with Pry add the following to your ~/.pryrb file
Thank you!
It should mostly work fine in 1.8.7 MRI and 1.8.7 RBX; i even backported Proc#source_location and Method#source_location so
show-method
andshow-doc
should work too, the only thing that doesnt work in 1.8.7 is source retrieval of methods defined inside the REPL; but it should be relatively rare you'd do this (i hope) :)Did you ever figure this out? I'm getting the same error.
For Windows users, the amazing reloading mechanism on
edit-method
works fine when using GVIM andset EDITOR=vim
After editing the file in vim and exiting type
load _file_
orreload-method Your#method_name
to manually reload the file. (where_file_
is a special local representing the last file accessed by Pry)I once got some colorful working with ansicon and those .irbrc . Some more fiddling may be required, hope that helps, Frank
Dont forget to mention that you need to install memcached in your system. It wasnt obvious to me and nothing worked until I ran
apt-get install memcached
I like vim but my colleagues not loving it and i can't use it as default on common server. But when i run pry $EDITOR=vim it still use nano =(
you can set the environment variable
$EDITOR
in your shell instead and Pry will use that. Why do you want to avoid settingPry.config.editor
btw?Is there any way to let methods like "show-method, edit, etc." use vim without binding to default editor?
@adnan4721 you should start Faye using Thin (as a separate process). You'll find a Rackup example for that on the Faye site: http://faye.jcoglan.com/ruby.html
Put your config into faye_config.ru and start it with the following command:
thin -R faye_config.ru start
I get the error, file "lin" not found
any ideas?
Asset pipeline is awesome, but how to deal with scripts like lightbox or wysiwyg, that distributed in one folder with local paths for included js, css and images? How to deal with this via asset pipeline?
hi,
I was having some issues thought i might share it here.
I am working on a rails3.1.0.rc6 app using the latest Omniauth gem to authentication user by tiwtter and facebook
But like the demo here on
is giving null response
but changing it to
seems to work fine.
I am not sure why this is happening
If i try
IRB = Pry
I get this:
ruby-1.8.7-p334/lib/ruby/1.8/irb/workspace.rb:19:in
initialize': undefined method
conf' for Pry:Class (NoMethodError)from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb/context.rb:27:in
new'
initialize'from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb/context.rb:27:in
from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb.rb:100:in
new'
initialize'from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb.rb:100:in
from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb.rb:59:in
new'
start'from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/irb.rb:59:in
from /Users/dragos/.rvm/rubies/ruby-1.8.7-p334/bin/irb:17