how about the live email account configuration that is similar with gmail smtp configuration?
example
username: myemail@live.com
password: SamplePassword
Nice episode.
I just had to handle a situation where I had to disply a custom error message on a ActiveRecord::RecordNotFound Exception for a specific controller.
Although this episode I can't figure out how to set a custom error message.
For Ubuntu 12.04 LTS and later, create the deployer user in the sudo group instead of the admin group (the sudo group has replaced the admin group, source).
For some reason when I click to confirm subscription at the very end, I get an "Unknown action.. The action 'update' could not be found for SubscriptionsController" error.
So on subscriptions#create, it's actually trying to point to the non-existent subscriptions#update. Any ideas why??
I was getting a "PG::Error connection closed" message. Here is the solution:
For Postgres users who are also using Spork, the Plataformatec blog solution will not work as stated. In other words, if you put the shared_db_connection.rb file in your spec/support directory, you will get a PG::Error connection closed message. Leave the file in spec/support but remove this line:
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
And instead put that in your Spork.each_run block in your spec_helper.rb file.
H/T nicholasmott from the comments section on the Plataformatec blog.
faye is really great ...I was using private_pub for 2 months then due to slow ajax requests and using thin server which is not suitable for thousands for connections I used nodejs server and It's more fast than ruby server but I am facing problem in security as I have a chat application and I am using the simple script for running faye
'
var http = require('http'),
faye = require('faye');
var bayeux = new faye.NodeAdapter({mount: '/faye', timeout: 45});
console.log('faye starting');
bayeux.listen(8080);
'
I hope I could find anyone who is running the nodejs server to help me
faye is really great ...I was using private_pub for 2 months then due to slow ajax requests and using thin server which is not suitable for thousands for connections I used nodejs server and It's more fast than ruby server but I am facing problem in security as I have a chat application and I am using the simple script for running faye
'
var http = require('http'),
faye = require('faye');
var bayeux = new faye.NodeAdapter({mount: '/faye', timeout: 45});
console.log('faye starting');
bayeux.listen(8080);
'
I hope I could find anyone who is running the nodejs server to help me
I am using this pattern to do the appropriate redirects to http if my controller and action doesn't need to be secure.
However, I am hitting this error - Filter chain halted as :https_redirect rendered or redirected
I am using apache and seems like something fairly basic I am missing.
...
...
ServerName XXXX
ProxyRequests Off
ProxyPreserveHost On
ProxyPassReverse / http://www.XXX.com/
RewriteEngine On
RewriteRule ^(.*) - [E=CLIENT_IP:%{REMOTE_ADDR},L]
RequestHeader set X-Forwarded-For %{CLIENT_IP}e
RequestHeader set X-Forwarded-Proto "https"
This doesn't work for me. All "page.should have_content" assertions fail under this stack. And when I do a "save_and_open_page", well, there's no styling and no JS. In other words, there's nothing available from the asset pipeline. It has been a real struggle. 5 12-hour days straight trying to set up this testing stack. What a waste.
Also, I'm having nothing but problems. I copied the same exact code for period and frequency and I get errors:
[{:code=>"11518", :messages=>["Invalid billing period.", "Billing period must be one of Day, Week, SemiMonth, or Year"]}, {:code=>"11516", :messages=>["Invalid billing frequency", "Billing frequency must be > 0 and be less than or equal to one year"]}]
I tried with omniauth twitter but I am getting NoMethodError
undefined method `info' for nil:NilClass when click on "Sign in using Twitter" link. I have attached gist for Full trace of error.
Any idea, how to solve this problem.
click_on question.
Trying to test a link that has a pdf to a file that is on a remote server.
But click_on will fail with this error.
No route matches [GET] "/u/54803135/Resume.pdf"
As if it is cutting the full url out for some reason?
If I look at the page it is fine and the url is in the source so not sure if there is a switch I am missing to tell click_on to pass the full url to page.response_headers['Content-Type'].should eq "application/pdf"
The url is nothing special just a simple url with some numbers.
Thanks
ps wrong thread? Just let me know if there is a good site to post this type of question, new to ruby/rails.
I don't believe Ryan has done one that focuses on just creating the to do list, but some good example of similar behaviour is when he was going through various javascript frameworks.
One thing not mentioned in the episode is that HTTP reserves the 409 status code to indicate conflicts. render status: :conflict also works. Set it for your response, especially in APIs.
I'd be interested to hear more about how you're approaching aggregation. I've started implementing an activity stream and am running into this challenge now.
Erick, is there any way you could provide an example of your suggestion? I'm also using pagination and would like the exported files to contain only the search results. (Not just the first 25 results as defined in my controller.)
I tried angularjs_scaffold as mentioned at the end of the video. But I see it's version of angular is 1.03 and seems like not much is happening on their github account either. angularjs_scaffold github
The approach you used in this video is nice for a 1 page app but just wondering how it would scale for a full site with numerous apps or features which is why I tried angularjs_scaffold.
Do you think angularjs_scaffold is still viable? And is the method in this tutorial good enough to build a full angular website.
What I mean by full website is that as with angularjs_scaffold, other than the welcome page, all the controllers output json and all the views are basically being managed by angular.
I was able to accomplish the same thing by having an @user = current_user for show, edit, update and destroy in the Users controller. However, your solution or mine, seems to remove the ideal of having all authorization located in one place given we have to adjust the Users controller to make things work there.
I'd guess the solution you came to with the do block in your member permission is the right direction. I'm going to play with that some.
When I sign_in i get redirect to same sign_in page. Not sure why this is happening...shouldnt default devise session controller should take care of this??
Hi I just want to ask on how to configure live email account by Microsoft on
My Gmail config that is working
how about the live email account configuration that is similar with gmail smtp configuration?
example
username: myemail@live.com
password: SamplePassword
Thanks!
Nice episode.
I just had to handle a situation where I had to disply a custom error message on a ActiveRecord::RecordNotFound Exception for a specific controller.
Although this episode I can't figure out how to set a custom error message.
Is there a way to edit the name?
I implemented this with my existing Projects views, creating a separate _tinyform partial so I could still edit each Project.
Problem: the submit button is gone, so my users cannot edit their Projects.
What do I do? Can I turn off the plug-in? Is that one of the advantages of using .on, perhaps?
Thanks! I'm a newbie in rails and especially in js.
For Ubuntu 12.04 LTS and later, create the
deployer
user in thesudo
group instead of theadmin
group (thesudo
group has replaced theadmin group
, source).For some reason when I click to confirm subscription at the very end, I get an "Unknown action.. The action 'update' could not be found for SubscriptionsController" error.
So on subscriptions#create, it's actually trying to point to the non-existent subscriptions#update. Any ideas why??
Is it true most of time service objects has only one public method for the action and class name could be verb? Any resources to learn more about it?
My datatable is always "Processing..." and never show the data, any idea?
Try changing carrierwave.rb in your initializer to:
end
nevermind, mistake on my end in following the pattern suggested. thanks
I was getting a "PG::Error connection closed" message. Here is the solution:
For Postgres users who are also using Spork, the Plataformatec blog solution will not work as stated. In other words, if you put the shared_db_connection.rb file in your spec/support directory, you will get a PG::Error connection closed message. Leave the file in spec/support but remove this line:
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
And instead put that in your Spork.each_run block in your spec_helper.rb file.
H/T nicholasmott from the comments section on the Plataformatec blog.
faye is really great ...I was using private_pub for 2 months then due to slow ajax requests and using thin server which is not suitable for thousands for connections I used nodejs server and It's more fast than ruby server but I am facing problem in security as I have a chat application and I am using the simple script for running faye
'
var http = require('http'),
faye = require('faye');
var bayeux = new faye.NodeAdapter({mount: '/faye', timeout: 45});
console.log('faye starting');
bayeux.listen(8080);
'
I hope I could find anyone who is running the nodejs server to help me
faye is really great ...I was using private_pub for 2 months then due to slow ajax requests and using thin server which is not suitable for thousands for connections I used nodejs server and It's more fast than ruby server but I am facing problem in security as I have a chat application and I am using the simple script for running faye
'
var http = require('http'),
faye = require('faye');
var bayeux = new faye.NodeAdapter({mount: '/faye', timeout: 45});
console.log('faye starting');
bayeux.listen(8080);
'
I hope I could find anyone who is running the nodejs server to help me
Simple and useful.Thanks.
Hi Ryan,
I am using this pattern to do the appropriate redirects to http if my controller and action doesn't need to be secure.
However, I am hitting this error - Filter chain halted as :https_redirect rendered or redirected
I am using apache and seems like something fairly basic I am missing.
...
...
ServerName XXXX
ProxyRequests Off
ProxyPreserveHost On
ProxyPassReverse / http://www.XXX.com/
RewriteEngine On
RewriteRule ^(.*) - [E=CLIENT_IP:%{REMOTE_ADDR},L]
RequestHeader set X-Forwarded-For %{CLIENT_IP}e
RequestHeader set X-Forwarded-Proto "https"
if i disable the filter, https works just fine.
any pointers on what may be wrong?
thanks
Add the following method to base.rb ...
Now use it in all recipes (3 in the example code) where 'add-apt-repository' is being used...
add_apt_repository 'ppa:nginx/stable'
You can add the following method to rbenv.rb:
Then you can just use the method to invoke rbenv wherever you need to ...
Hi, Ryan, is this a typo ?
Thanks
FactoryGirl fails with:
undefined method `error_field' for nil:NilClass
No stack trace given, naturally.
<title><%= content_for?(:title) ? yield(:title) + " - Company" : "Company" %></title>
This works well if you want to add the company name at the end of the title string instead of in the beginning like the video shows.
Thanks
:+1: really enjoyed this episode.
This doesn't work for me. All "page.should have_content" assertions fail under this stack. And when I do a "save_and_open_page", well, there's no styling and no JS. In other words, there's nothing available from the asset pipeline. It has been a real struggle. 5 12-hour days straight trying to set up this testing stack. What a waste.
Has anyone been able to get CarrierWave and RMagick to work on jRuby?
My error: uninitialized constant Magick::ImageMagickError
Same error with RMagick4J...
Also, I'm having nothing but problems. I copied the same exact code for period and frequency and I get errors:
[{:code=>"11518", :messages=>["Invalid billing period.", "Billing period must be one of Day, Week, SemiMonth, or Year"]}, {:code=>"11516", :messages=>["Invalid billing frequency", "Billing frequency must be > 0 and be less than or equal to one year"]}]
What if you wanted to handle the API on a subdomain?
Hi all,
I tried with omniauth twitter but I am getting NoMethodError
undefined method `info' for nil:NilClass when click on "Sign in using Twitter" link. I have attached gist for Full trace of error.
Any idea, how to solve this problem.
DurandalJS vs. AngularJS
Thanks! I have been stucked on how to modify the default bootstrap variable for a long time. You saved a lot of my time.
click_on question.
Trying to test a link that has a pdf to a file that is on a remote server.
But click_on will fail with this error.
No route matches [GET] "/u/54803135/Resume.pdf"
As if it is cutting the full url out for some reason?
If I look at the page it is fine and the url is in the source so not sure if there is a switch I am missing to tell click_on to pass the full url to page.response_headers['Content-Type'].should eq "application/pdf"
The url is nothing special just a simple url with some numbers.
Thanks
ps wrong thread? Just let me know if there is a good site to post this type of question, new to ruby/rails.
If you have a problem with assets not showing make sure you remove the "http://" from this line:
config.action_controller.asset_host = "http://" + config.domain
He has! Search for "offline"
I don't believe Ryan has done one that focuses on just creating the to do list, but some good example of similar behaviour is when he was going through various javascript frameworks.
In Backbone.js
http://railscasts.com/episodes/323-backbone-on-rails-part-1
http://railscasts.com/episodes/325-backbone-on-rails-part-2
In Ember:
http://railscasts.com/episodes/408-ember-part-1
http://railscasts.com/episodes/410-ember-part-2
In AngularJS:
http://railscasts.com/episodes/405-angularjs
I ran into this same issue...
template is a method that is defined in templates/base.rb
One thing not mentioned in the episode is that HTTP reserves the 409 status code to indicate conflicts.
render status: :conflict
also works. Set it for your response, especially in APIs.Indeed - it may be not needed for HTML version, but definitely JSON API would benefit from having the right status code:
I'd be interested to hear more about how you're approaching aggregation. I've started implementing an activity stream and am running into this challenge now.
Also, I'm trying to think of a good design pattern for how comments on aggregate stories should work. You can see more here: http://stackoverflow.com/questions/16339228/how-to-approach-aggregating-actvities-in-feeds-and-then-handling-comments
whats the difference between "Website Payments Pro" and "Payflow Pro"? This tutorial is already outdated.
Erick, is there any way you could provide an example of your suggestion? I'm also using pagination and would like the exported files to contain only the search results. (Not just the first 25 results as defined in my controller.)
Might want to try something like this, Al. (Stolen from a post above.)
format.csv { render :text => Product.to_csv }
I tried following this screencast and gave up because I was running into an issue identical to what Andy Weber found.
Am currently using the following code, which does work:
format.csv { render :text => Product.to_csv }
I tried angularjs_scaffold as mentioned at the end of the video. But I see it's version of angular is 1.03 and seems like not much is happening on their github account either.
angularjs_scaffold github
The approach you used in this video is nice for a 1 page app but just wondering how it would scale for a full site with numerous apps or features which is why I tried angularjs_scaffold.
Do you think angularjs_scaffold is still viable? And is the method in this tutorial good enough to build a full angular website.
What I mean by full website is that as with angularjs_scaffold, other than the welcome page, all the controllers output json and all the views are basically being managed by angular.
Thanks for the great vids!
Al
As said above, in your model
def count_positive
evaluations.where( target_type: self.class, target_id: self.id, value: 1.0 ).count
end
def count_negative
evaluations.where( target_type: self.class, target_id: self.id, value: -1.0 ).count
end
then you can sum up both in your view
or
def count_total
evaluations.where( target_type: self.class, target_id: self.id, value: 1.0 ).count + evaluations.where( target_type: self.class, target_id: self.id, value: -1.0 ).count
end
instead of spamming this comment section, you should post or search on stackoverflow.com ...
I was able to accomplish the same thing by having an @user = current_user for show, edit, update and destroy in the Users controller. However, your solution or mine, seems to remove the ideal of having all authorization located in one place given we have to adjust the Users controller to make things work there.
I'd guess the solution you came to with the do block in your member permission is the right direction. I'm going to play with that some.
Also couldnt figure out how to open errors in sublime.
I'm using Ubuntu 12.04
:-/
Thanks, Brian. I was just banging my head against my keyboard. I guess I'll have to stick with crafting my search queries myself for now.
Change @collection.fetch() to @collection.fetch({reset: true})
Thank's dude
When I sign_in i get redirect to same sign_in page. Not sure why this is happening...shouldnt default devise session controller should take care of this??