Can you expand on when you should and shouldn't use polymorphic associations? I was thinking of using them for :imagable photos on my applications (users, events, classes, projects, etc all have many photos each via Paperclip). Seems like a great way to make some very DRY code.
I'd love to see this. My Textmate-fu is weak compared to Ryan's and I'm constantly picking up little tips from him. I'd love to see more in the same place.
Great screencast, but I got stuck. Don't know how to set them ENV['TWITTER_KEY'] and ENV['TWITTER_SECRET'] variables. How do I set them? Is there a config file for that?
I have started playing with meteor. Developing is very smooth and fun. I get this "it just works" feeling, although there is still a lot missing in meteor. ;-) Actually I started first with derby as well, as it was also more appealing to me, however, I couldn't even get the examples to work. And reading the issues I found I'm not the only one.
I've toyed with Derby and Meteor quite a bit over the last few weeks. Derby JS is by far my favorite. The biggest hurdle for both of these frameworks as a node novice has been lack of documentation but both of these frameworks are nothing short of revolutionary! Meteor has several full time programmers and a larger following, but at the end of the day Derby just makes more sense to me.
What happens if the access token expires? The user should be not allowed to login again and should go through the Oauth process again, and the database should be cleaned for this user.
Got this up and running but seems to indent any code after line 1 by an extra four spaces. Anyone know if this is a pygments or Redcarpet issue or how to fix it?
I'm pretty sure that the certificates place correctly and I'm still getting this error while I'm trying to publish something:
Exception
OpenSSL::SSL::SSLError
Error
SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
(The first one's the critical one, but second seems appropriate too.)
This changes the limits in the currently-running kernel. To make these values stick across reboots, add them to /etc/sysctl.conf, like this:
Ryan says in the end of the cast that Meteor is "only" for rich client side applications he is not normally working on. It appears to me though the trend for ALL web apps is currently exactly going towards that direction. Towards more interactive, javascript rich and snappy websites. As it is stated on the DerbyJS website: why not having realtime data push updates as a default on all websites if it is possible? To me it seems frameworks like Meteor and Derby are the future of web development. They also significantly improve the development experience by making browser reloads unnecessary. Opinions? I'd love to hear what others think. Especially, are there any use cases where "traditional" server side heavy frameworks like Rails are fundamentally working better than those new type of frameworks?
I do not want the event to occur every day, I want the event to occur only on Monday / Wednesday / Friday or Tuesday / Thursday between two different dates.
I'm using a generate_access_token in my User model to create an access_token for each user so that my app can do "Remember Me" using a cookie (so they don't need to login again) as per screencast #274.
Would I use this same access_token field for the user to be able to call my API?
Can you see any issue in doing that?
Or should they be different?
pjax_rails gem has changed significantly since this railscast was released and hence if you are trying to use it as per screencast, you may face errors.
First thing is, pjax_rails plugin does not add that pjax handler by default to all the links anymore. You will have to specify the elements for which you want pjax to work via, $('a').pjax('#data-pjax-container')
Seond thing, pjax_rails will automatically disable layout rendering if it it detects request is of type pjax.
1) Only set the url in development so when I deploy to Heroku the production database url gets picked up.
2) Use QC_DATABASE_URL instead of DATABASE_URL. Apparently Rails actually uses DATABASE_URL instead of database.yml if DATABASE_URL is present. This will cause your tests to start failing, despite the Rails.env.development? guard, due to the initializer running prior to Rails.env getting set to "test". This is confusing, but put a puts Rails.env into the initializer and watch the output when you run rake test and you'll see "development" and then "test" as Rails runs your tests.
Hope that helps someone. Great Railscast as always Ryan!
Awesome railscast Ryan! One thing... each time I log into my application (www.Meer.li), it logs me out whenever I close the browser. How do I save and retrieve the user with a cookie instead of the session, so the user will be logged in automatically when he visits the page the next time?
Hope you have a solution. Would really appreciate it!
Between this and Private Pub seems like a great solution. I have a use case for this gem however I will be using devise for authentication and need to somehow get the current_user and have them show up in a chat window.
Does anyone know a clean way to get this or something similar working. It's kind of pointless to have a chat system with 20 people logged in whom you can't tell who's who.
my mistake was that I did not add 'survey_id:integer' while generating questions model. it solved the problem
Thanks..
Can you expand on when you should and shouldn't use polymorphic associations? I was thinking of using them for :imagable photos on my applications (users, events, classes, projects, etc all have many photos each via Paperclip). Seems like a great way to make some very DRY code.
I'd love to see this. My Textmate-fu is weak compared to Ryan's and I'm constantly picking up little tips from him. I'd love to see more in the same place.
Hi guys, i've ran into this problem.
ActionView::MissingTemplate in Notes#index
Which fails at: <%= render 'notes' %>
Should i be adding anythign else to my controller?
def index
end
How would one do this with devise?
Quick and dirty:
Open .bash_profile in your favorite editor eg:
mate ~/.bash_profile
Add the two ENV variables like so:
export TWITTER_KEY=your_twitter_key
export TWITTER_SECRET=your_twitter_secret
Save and close the file
Either quit your terminal session & restart or reload it with:
source ~/.bash_profile
Great screencast, but I got stuck. Don't know how to set them ENV['TWITTER_KEY'] and ENV['TWITTER_SECRET'] variables. How do I set them? Is there a config file for that?
Would really be glad If anyone could help.
did you have to restart nginx or the app?
Try rack api throttling with a rack middleware. I forked it to limit throttling to a certain path: https://github.com/christoph-buente/api-throttling
Looks really nice :)
nevermind im about to throw my pc out the window
had to use dos2unix on the unicorn_init.sh in order to get it to insterpret it righ
thanks!
for some reason, at the last step on cap deploy:cold it is not allowing me access. this is the output:
* executing `deploy:start' * executing "/etc/init.d/unicorn_mock_app start" servers: ["MYIP"] [MYIP] executing command ** [out :: MYIP] sh: /etc/init.d/unicorn_mock_app: Permission denied command finished in 150ms failed: "sh -c '/etc/init.d/unicorn_mock_app start'" on IP
I tried changing the permission to the symlink by running:
chmod +x /etc/init.d/unicorn_mock_app
But then it outputs
any ideas?? on why it wont allow permissions for the app to start
Just had to give a thumbs up to the first ever episode
I have started playing with meteor. Developing is very smooth and fun. I get this "it just works" feeling, although there is still a lot missing in meteor. ;-) Actually I started first with derby as well, as it was also more appealing to me, however, I couldn't even get the examples to work. And reading the issues I found I'm not the only one.
in ASCII-Cast, the view of the form should be
you forgot the = (equal sign), so the questions would not appear ;-)
keep on casting, very good work ryan
marcello - railszilla.com
You can't use "upstream unicorn", you have to customize for each app "upstream unicorn_app1". I got stuck there too.
I've toyed with Derby and Meteor quite a bit over the last few weeks. Derby JS is by far my favorite. The biggest hurdle for both of these frameworks as a node novice has been lack of documentation but both of these frameworks are nothing short of revolutionary! Meteor has several full time programmers and a larger following, but at the end of the day Derby just makes more sense to me.
pg is transactional and just generally pretty nice.
What happens if the access token expires? The user should be not allowed to login again and should go through the Oauth process again, and the database should be cleaned for this user.
Great episode! looking forward to see next episodes on recurring billing.
What's the most elegant way to use draper in common with the ancestry gem from episode #262? How do I get all children and parents easily decorated?
Turns out this is a haml issue (http://stackoverflow.com/questions/6325416/maruku-incorrectly-parsing-second-line-of-code-blocks).
It can be fixed by adding 'preserve' i.e.
= preserve @foo
Got this up and running but seems to indent any code after line 1 by an extra four spaces. Anyone know if this is a pygments or Redcarpet issue or how to fix it?
I'm in the same boat, I'd love a little guidance on this.
Hi Everyone,
I'm trying to work with https, I used this configuration (https://github.com/ryanb/private_pub#serving-faye-over-https-with-thin)
and I declared the gem directly from github gem "private_pub", :git => "https://github.com/ryanb/private_pub.git".
I'm pretty sure that the certificates place correctly and I'm still getting this error while I'm trying to publish something:
Exception
OpenSSL::SSL::SSLError
Error
SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
Thanks a lot
UPDATE: You have to wrap the following code around the columns loop to get it working with migrations:
I can access the '/api/resource.json' but there is an error while trying access '/api/v2/resource.json'
No route matches [GET] "/api/v1/companies/00000000000001/reports.json"
No route matches [GET] "/api/v2/companies/00000000000001/reports.json"
Great, thanks. I'll look into it straight away :-).
thanks! ENV["DATABASE_URL"] = "postgres://localhost/mailer_development" doesn't work for me as well.
but i get "undefined method `load_functions' for QC::Queries:Module" when trying to migrate, why is this?
Chapter 8 of railstutorial shows you how to do that: http://ruby.railstutorial.org/chapters/sign-in-sign-out#top
Pay particular attention to section: 8.2.1 titled "Remember me"
I would love to see the
match
operator make its way intoActiveSupport
. Such an awesome, clean syntax.Sure, everyone, who has
problem, can easily fix this.
Run:
(The first one's the critical one, but second seems appropriate too.)
This changes the limits in the currently-running kernel. To make these values stick across reboots, add them to /etc/sysctl.conf, like this:
Found this here
Ryan says in the end of the cast that Meteor is "only" for rich client side applications he is not normally working on. It appears to me though the trend for ALL web apps is currently exactly going towards that direction. Towards more interactive, javascript rich and snappy websites. As it is stated on the DerbyJS website: why not having realtime data push updates as a default on all websites if it is possible? To me it seems frameworks like Meteor and Derby are the future of web development. They also significantly improve the development experience by making browser reloads unnecessary. Opinions? I'd love to hear what others think. Especially, are there any use cases where "traditional" server side heavy frameworks like Rails are fundamentally working better than those new type of frameworks?
I do not want the event to occur every day, I want the event to occur only on Monday / Wednesday / Friday or Tuesday / Thursday between two different dates.
Please, somebody help me, I need a lot.
Since now I thank
Very useful screencast Ryan.
I'm using a
generate_access_token
in myUser
model to create anaccess_token
for each user so that my app can do "Remember Me" using a cookie (so they don't need to login again) as per screencast #274.Would I use this same
access_token
field for the user to be able to call my API?Can you see any issue in doing that?
Or should they be different?
Since prepend_view_path seems to be depreciated in rails 3.2, im looking for the "right" way todo it in 3.2.. any thoughts anyone?
Goog question from Brandon Williams. Can Jbuilder templates be used inside of layouts?
Maximum that I have been to achieve is this:
pjax_rails gem has changed significantly since this railscast was released and hence if you are trying to use it as per screencast, you may face errors.
First thing is, pjax_rails plugin does not add that pjax handler by default to all the links anymore. You will have to specify the elements for which you want pjax to work via, $('a').pjax('#data-pjax-container')
Seond thing, pjax_rails will automatically disable layout rendering if it it detects request is of type pjax.
thank you. saved me a heart-burn pill
From looking at the source quickly -- it seems only the User model is slightly different as some logic from the controller was moved to it.
What's new in this episode?
Taps stopped working with Rails 3.2.5 for some reason, so I thought I'd finally give Valkyrie a try.
Whoa! Nice. Easier than I expected, although it's significantly slower pushing local data to my remote postgre db server on Linode.
I needed a:
ENV["QC_DATABASE_URL"] = "postgres://localhost/mailer_development" if Rails.env.development?
instead of:
ENV["DATABASE_URL"] = "postgres://localhost/mailer_development"
in config/initializers/queue_classic.rb
The two differences:
1) Only set the url in development so when I deploy to Heroku the production database url gets picked up.
2) Use QC_DATABASE_URL instead of DATABASE_URL. Apparently Rails actually uses DATABASE_URL instead of database.yml if DATABASE_URL is present. This will cause your tests to start failing, despite the Rails.env.development? guard, due to the initializer running prior to Rails.env getting set to "test". This is confusing, but put a puts Rails.env into the initializer and watch the output when you run rake test and you'll see "development" and then "test" as Rails runs your tests.
Hope that helps someone. Great Railscast as always Ryan!
Awesome railscast Ryan! One thing... each time I log into my application (www.Meer.li), it logs me out whenever I close the browser. How do I save and retrieve the user with a cookie instead of the session, so the user will be logged in automatically when he visits the page the next time?
Hope you have a solution. Would really appreciate it!
Changed from Bj(no longer supported in Rail3) to Delayed_job but seems not to handle rails runner.
lib/report_job.rb
class ReportJob < Struct.new(:prawn_script_name , :account_id )
def perform
bundle exec rails runner "#{Rails.root}/jobs/#{prawn_script_name}.rb #{account_id}"
end
Error in last_error field.
{undefined method `runner' for #ReportJob:0xc28f080
OUCH! .... will try Resque.
Actually I just read that you can use npm modules: http://stackoverflow.com/questions/10165978/how-do-we-or-can-we-use-node-modules-via-npm-with-meteor
So no lock in after all?
Between this and Private Pub seems like a great solution. I have a use case for this gem however I will be using devise for authentication and need to somehow get the current_user and have them show up in a chat window.
Does anyone know a clean way to get this or something similar working. It's kind of pointless to have a chat system with 20 people logged in whom you can't tell who's who.
Thanks!
Are you aware of this episode? Was revised recently...
http://railscasts.com/episodes/154-polymorphic-association-revised
@search = Product.solr_search do
I have the same question