Do you have any experience with combining multitenancy, with load balancing between replicated databases? Unfortunately Apartment doesn't play nice with a gem like Octopus which also patches ActiveRecord so they conflict ... I have been searching hi and low for a solution to this...
I had the same error, but my problem was not the redirect, but rather my Amazon S3 bucket parameter was incorrect, i.e., ENV["AWS_S3_BUCKET"] was not set to the correct value.
I had a "gotcha" with the S3Uploader class because my rails application always has a time zone set other than UTC and so my s3 request was failing with an invalid expiration time policy.
I just had to add the .utc to the end of this line in the S3Uploader intialize to get it working...
In case anyone is curious on how this performs against Capybara-webkit as the driver, I found it to be ~10% faster. Additionally, the error messages are much more helpful.
Capybara automatically waits for the content to appear. There's a default time it will wait that you can override. I'm not sure how you would reliably test for the "Fetching more orders.." part though. I'm betting that you would run into instances where that disappeared before Capybara could verify it was there.
Hey guys, I just packaged this all into a gem called magiconf. It's super simple and easy to use. Based off of this + figaro. https://github.com/sethvargo/magiconf
I have an older project using Rails 2.3.14 and Ruby 1.8.7. Some of the routing constructs used here don't appear to be available in Rails 2. Any suggestions for how to implement a similar versioning system in Rails 2?
everytime i want to start "rackup faye.ru -s thin -E production" i only get the error
`require': cannot load such file -- faye (LoadError) but the gem is installed.. anybody an idea ?
Thanks for this episode.
In the scrolling test case, I didn't catch how it works under the hood. As I understand it correct, the content "Order #11" is not present immediately after calling page.evaluate_script("window.scrollTo(0, document.height)").
Does this command wait for the content? If so, how should I test that message "Fetching more orders..." is showed (just for a while)?
Once you start using more third party plugins, more advanced UI, own workflow and bindings, turbolinks may be a potential blocker. It can be useful, but only for simple sites, sites without too many legacy javascript code and plugins. So it is not better for every site, for sure.
As of Bootstrap 2.2.1 the plugins listen to document instead of body, so modification shouldn't be necessary. You'll still need make other $(document).ready stuff happen on page:load as well though.
Designing a site with turbo links in mind is a lot easier than making turbo links work on an existing site. In fact, it's a great tool to have in the rails stack by default. If I had to guess the rails team put it there because it genuinely makes every site better, and with little cost when designing a new app
Thank you for the railscast. I am having some problem redirecting the job to the resque-worker. I followed the similar steps as shown in the railscast. When I do
ruby
Resqueue.enqueue(SnippetHighlighter, @snippet.id)
I get the error that SnippetHighlighter is undefined in the rails server, not in the resque-web. I also have problem opening resque-web. It gives me strange error says: /usr/lib/ruby/1.8/net/http.rb:560: in 'initialize': getaddrinfo: Name or service not known(SocketError).
Does anyone here know what is wrong.? I am using Ubuntu 12.04.
Hi Ryan,
I followed this railscast and it helped me a lot in setting up a server recently however there is one weird issue I am encountering right now.
Whenever I enter my domain like www.example.com it gets redirected to the IP of the linode box having the rails application like xx.xxx.xx.xx. I have no idea why I am having this issue.I know it has something to do with Nginx configuration. Can you guide me what to modify to get this working ?
When I try to create a new lookup I get an error. The error says "Missing partial lookups/lookup." Didn't Ryan say that render is coming from the controller? Why is it looking for the partial instead?
After playing a while with Turbolinks I had to disable it. Too many small problems with other JavaScript code. it also does not fit to more complex scenarios. I wonder why Rails core team decided to add Turbolinks to incoming Rails 4. For more complex site, all those additional side effects are not worth. I think, that full blown Javascript MVC framework (e.g. AngularJS) can be a better way. Not only faster (only chosen parts of the page are refreshed) but also simpler (no jQuery spaghetti hell, thanks to two-way data binding)
Can someone explain more completely how this is different from PJAX? I hear everyone say "turbolinks is such a bad idea", although they offer nothing constructive. Is PJAX not a bad idea? I mean github uses it so it can't be that bad... If PJAX is fine, could they not implement it in the same way so it isn't "so bad".
That successfully removes column names that aren't created from foreign keys.
Let's say there's a product model that has many photos, then a has photos option will appear in the drop down, do you know how to remove it? Thank you.
Thank you @LucasCioffi, changing the location of my link_to_add definitely fixed the undefined method error!
I had the same issue but your change gave me the error:
can't convert Array into Hash
format.csv { send_data Product.to_csv }
worked for me.why not just before_filter?
Do you have any experience with combining multitenancy, with load balancing between replicated databases? Unfortunately Apartment doesn't play nice with a gem like Octopus which also patches ActiveRecord so they conflict ... I have been searching hi and low for a solution to this...
I had the same error, but my problem was not the redirect, but rather my Amazon S3 bucket parameter was incorrect, i.e., ENV["AWS_S3_BUCKET"] was not set to the correct value.
I had a "gotcha" with the S3Uploader class because my rails application always has a time zone set other than UTC and so my s3 request was failing with an invalid expiration time policy.
I just had to add the .utc to the end of this line in the S3Uploader intialize to get it working...
In case anyone is curious on how this performs against Capybara-webkit as the driver, I found it to be ~10% faster. Additionally, the error messages are much more helpful.
You can try https://github.com/bkeepers/dotenv, it's simple and does what it says
legendary! Wasted 5 hours+ on that!!!
Capybara automatically waits for the content to appear. There's a default time it will wait that you can override. I'm not sure how you would reliably test for the "Fetching more orders.." part though. I'm betting that you would run into instances where that disappeared before Capybara could verify it was there.
Where do I get the CONSUMER_KEY/CONSUMER_SECRET for omniauth-google?
Hey guys, I just packaged this all into a gem called
magiconf
. It's super simple and easy to use. Based off of this + figaro. https://github.com/sethvargo/magiconfnm,
it was because of the non-restful reset link in the mail template.
Because I'm using multi-tenancy, and locales this is what my password_reset method must look like:
Now I have
and now I have problem with find user
undefined method
find_by_create_remember_token!' for #Class:0x007fca97926210`I have an older project using Rails 2.3.14 and Ruby 1.8.7. Some of the routing constructs used here don't appear to be available in Rails 2. Any suggestions for how to implement a similar versioning system in Rails 2?
I'm missing something trivial here.
but I want to see the reset_token parameter here don't I?
Hi when I try to reset password I get this error:
ArgumentError in PasswordResetsController#create
wrong number of arguments (1 for 0)
app/models/user.rb:48:in
create_remember_token'app/models/user.rb:40:in
send_password_reset'
create'`app/controllers/password_resets_controller.rb:7:in
Have anybody an Idea why?
everytime i want to start "rackup faye.ru -s thin -E production" i only get the error
`require': cannot load such file -- faye (LoadError) but the gem is installed.. anybody an idea ?
Thanks for this episode.
In the scrolling test case, I didn't catch how it works under the hood. As I understand it correct, the content "Order #11" is not present immediately after calling
page.evaluate_script("window.scrollTo(0, document.height)")
.Does this command wait for the content? If so, how should I test that message "Fetching more orders..." is showed (just for a while)?
http://railscasts.com/episodes/85-yaml-configuration-revised
:-)
Once you start using more third party plugins, more advanced UI, own workflow and bindings, turbolinks may be a potential blocker. It can be useful, but only for simple sites, sites without too many legacy javascript code and plugins. So it is not better for every site, for sure.
As of Bootstrap 2.2.1 the plugins listen to document instead of body, so modification shouldn't be necessary. You'll still need make other $(document).ready stuff happen on page:load as well though.
Have anyone ever tried twitter-bootstrap-rails with select2-rails ?. It seems that the select2-rails is not working with the twitter bootstrap.
Thanks for reporting that, I've updated the ASCIIcast to show the correct filename for the partial :)
Thanks for this. Just what i was looking for. Works perfectly.
Designing a site with turbo links in mind is a lot easier than making turbo links work on an existing site. In fact, it's a great tool to have in the rails stack by default. If I had to guess the rails team put it there because it genuinely makes every site better, and with little cost when designing a new app
This is an unbelievably awesome platform, very interesting..
Thank you for the railscast. I am having some problem redirecting the job to the resque-worker. I followed the similar steps as shown in the railscast. When I do
I get the error that
SnippetHighlighter is undefined
in the rails server, not in the resque-web. I also have problem opening resque-web. It gives me strange error says:/usr/lib/ruby/1.8/net/http.rb:560: in 'initialize': getaddrinfo: Name or service not known(SocketError)
.Does anyone here know what is wrong.? I am using
Ubuntu 12.04
.Hi Ryan,
I followed this railscast and it helped me a lot in setting up a server recently however there is one weird issue I am encountering right now.
Whenever I enter my domain like www.example.com it gets redirected to the IP of the linode box having the rails application like xx.xxx.xx.xx. I have no idea why I am having this issue.I know it has something to do with Nginx configuration. Can you guide me what to modify to get this working ?
In my create.js.erb, I have this:
$('.lkuptbody').append('<%= j render(@lookup) %>');
When I try to create a new lookup I get an error. The error says "Missing partial lookups/lookup." Didn't Ryan say that render is coming from the controller? Why is it looking for the partial instead?
FWIW, I implemented a simple around_filter as shown here in my ApplicationController and it has massively slowed down my requests:
In the ASCIIcast when you move the condition fields into it's own partial. The header for that snippet still says:
/app/views/products/index.html.erb
But it should say:
/app/views/products/_condition_fields.html.erb
Thanks for an awesome episode,
Andy
Just using
$(document.body).on
makes everything work as expected (if you need to add javascript files from an AJaX query)
After playing a while with Turbolinks I had to disable it. Too many small problems with other JavaScript code. it also does not fit to more complex scenarios. I wonder why Rails core team decided to add Turbolinks to incoming Rails 4. For more complex site, all those additional side effects are not worth. I think, that full blown Javascript MVC framework (e.g. AngularJS) can be a better way. Not only faster (only chosen parts of the page are refreshed) but also simpler (no jQuery spaghetti hell, thanks to two-way data binding)
Can someone explain more completely how this is different from PJAX? I hear everyone say "turbolinks is such a bad idea", although they offer nothing constructive. Is PJAX not a bad idea? I mean github uses it so it can't be that bad... If PJAX is fine, could they not implement it in the same way so it isn't "so bad".
Well, you could add
:dependent => :destroy
to eachhas_many
association. and then simply delete your Survey!I encountered this too!.. any solutions so far?
Sweet.. I was looking for this... Thanks!
Same problem, different solution
http://stackoverflow.com/questions/8177331/problems-with-guard-spork-rspec-rails-3
remove the test folder, which i guess result in test_unit not being used
Running the scaffold generator without the nifty gem creates a field in the migration called 'create'
Try Localtunnel
I am also struggling with how to administrate a multi tenant app, and have not found much info about this elsewhere.
I'm not sure, but maybe creating an admin user:
would suffice?
Not sure how to do this though.. searching...
I would just make it a nested resource if you could and grab it off the params array like params[:establishment_id]
So you would be on page like:
http://example.com/establishment/123/category/new
And that would post to
http://example.com/establishment/123/category
And you could pull off params[:establishment_id]
Look again. It went from 140 seconds to 80 seconds.
This looks really great. I will test it. Its a lot less magic than turbolinks.
Thanks, I was also asking myself the same question!
That successfully removes column names that aren't created from foreign keys.
Let's say there's a product model that has many photos, then a has photos option will appear in the drop down, do you know how to remove it? Thank you.
So how would you cache json? I think I am missing something obvious.
Hello Ryan,
When I do the steps I still get a email can't be blank error message. Im trying to log in by username instead of email.