So all that "complex" logic goes in the js files, and routing is done through angular. Does all of this make the rails functionality for these tasks redundant? How do you resolve or use both simultaneously?
@Jen Did you ever figure out why you were getting 500 internal server error when hitting /auth/facebook? I'm experiencing the same issue. Any help is appreciated!
Wouldn't it be better if we put this Cart#paypal_url method into a helper (eg. CartsHelper). Then, we don't have to pass the return_url around.
I don't really see how generating a paypal url is the responsibility of the Cart model. And the url is only being referenced in the view anyway. I think the helper is a better place for this kind of thing.
I ran into the same method. I have a project model with many conflicts through project_conflicts. I want to isolate conflicts to the user that generates them though.
My solution was to add an after_create callback on the join model that updated the newly generated conflict object with the project's user_id. This seems to be working since the join belongs to both and is created last.
This seems to be the only reference I can find on the net to run thor through zeus. However, I'm slightly unsure what you mean. What's thor.json? I've had a ganders through thor's docs and can't find a reference to it. And what's custom_plan.rb? Is that one of your own commands?
hi everyone I am rails beginner I need some modifications in the calendar how do change this calendar with link that when I click an any date it has to show the corresponding day below the calendar.....please share your ideas...
Adding separate env for staging looks like not a good idea, because it will differ from real production. BTW you can use special service for stages https://teatro.io/ that will automate the whole process.
I've been getting "undefined method `fog_credentials=' for CarrierWave::Uploader::Base:Class" every time I tried to run rake db:reset or rails s. Could anyone please help?
You are correct, update_all is called once for each faq item, which results in a separate query for each faq item. The performance gain is because update_all updates the order field in a single query as opposed to first loading the model then doing an update in a separate query.
This still works in Rails 4 by the way, but the syntax is a little different:
Please note the new ActiveModel::Model available in Rails 4 which makes it much easier to create a tableless model. In fact, the code shown in this screencast for the model doesn't actually work fully with Rails 4 presumably because of this change (at least it didn't work for me). For info, see: http://blog.plataformatec.com.br/2012/03/barebone-models-to-use-with-actionpack-in-rails-4-0/
Would it be possible to use this with nested items?
IE I have a view setup with many Todo Lists and I'd like to be able to add Todo Items under those lists dynamically. (basically how a todo list works at Basecamp)
I have the proper associations taken care of, so I can add Todo Items to Todo Lists via the HTML form, but can't figure out how to pass the todo_list_id through jquery to use the remote option.
I have the same issue, did you figure out why its happening ? when i put "production.foo.com" in url...it shows the same message as yours. Please help !
THIS GEM DOES NOT WORK WITH RAILS 4. Don't even try it. The employee who made it formerly worked for Twitter, then left Twitter, and no one else on the team is interested in supporting it. Recommend the Thumbs Up gem. https://github.com/bouchard/thumbs_up
If you need just staging server you could use https://teatro.io/
It's easy to test UI changes with https://teatro.io/
@avadhbsd Use omniauth-facebook gem version 1.4.0. According to many comments elsewhere. 1.4.0 is the "most/last stable version". Some folks mentioned that certain versions of rails conflict with the omniauth-facebook gem also. See this link for more: http://stackoverflow.com/questions/13425757/rails-facebook-login-error-with-omniauth-facebook-omniauthstrategiesoauth2
Hey I am having a similar issue, no idea on next steps could you help?
So all that "complex" logic goes in the js files, and routing is done through angular. Does all of this make the rails functionality for these tasks redundant? How do you resolve or use both simultaneously?
@Jen Did you ever figure out why you were getting 500 internal server error when hitting /auth/facebook? I'm experiencing the same issue. Any help is appreciated!
Wouldn't it be better if we put this Cart#paypal_url method into a helper (eg. CartsHelper). Then, we don't have to pass the return_url around.
I don't really see how generating a paypal url is the responsibility of the Cart model. And the url is only being referenced in the view anyway. I think the helper is a better place for this kind of thing.
I ran into the same method. I have a project model with many conflicts through project_conflicts. I want to isolate conflicts to the user that generates them though.
My solution was to add an after_create callback on the join model that updated the newly generated conflict object with the project's user_id. This seems to be working since the join belongs to both and is created last.
Same issue for me.
Edit:
It is a relatively simple fix for rails 4 due to the lack of attr_accessible.
I watched the video and followed all the instruction of Fnordmetric railscast.
install redis
redis-server /usr/local/etc/redis.conf
Redis is working fine on my local(Ubuntu 12.04)
gem install fnordmetric
Installed successfully.
Created new fnordmetric.rb file
When I run ruby fnordmetric.rb on terminal
$ ruby fnordmetric.rb
./fnordmetric.rb:3: uninitialized constant FnordMetric (NameError)
from fnordmetric.rb:1:in `require'
from fnordmetric.rb:1
I am getting above error.
Please help me to fix this issue and get it working
Thanks in advance
hi i am using rails 4.1.2, ruby 2.0.0
I upgraded the application form rails 3.2.14 to rails 4.1.2
ActiveModel::ForbiddenAttributesError in AAAAAImportsController#create
ActiveModel::ForbiddenAttributesError
in my controller and removed attr_accessible in model
Same here... Any idea?
in savon 2 that will be
client = Savon.client(wsdl: "http://www.webservicex.net/uszip.asmx?WSDL", basic_auth: ["user", "secret"])
If someone like me is wondering about how the example lines are in savon 2, they are like this.
client = Savon.client(wsdl: "http://www.webservicex.net/uszip.asmx?WSDL")
client.operations
client.call(:get_info_by_zip, message: { "USZip" => "90210" })
I have the very same problem. Did you find a solution?
Changing Authentication Fields is not working with Rails 4 and Devise. May be it's due to attr_accessible. What should I replace it with and why?
Hi Ryan
Just wanted to say thank you very much for an excellent video. Hope you are doing well and that you soon have enough energy to return to railscast.
so years later in rails 4, is Kaminari still better, cleaner, and frequently updated as will_paginate?
This seems to be the only reference I can find on the net to run thor through zeus. However, I'm slightly unsure what you mean. What's
thor.json
? I've had a ganders through thor's docs and can't find a reference to it. And what'scustom_plan.rb
? Is that one of your own commands?hi everyone I am rails beginner I need some modifications in the calendar how do change this calendar with link that when I click an any date it has to show the corresponding day below the calendar.....please share your ideas...
If you need VPS just for stage you can use https://teatro.io/ instead.
Adding separate env for staging looks like not a good idea, because it will differ from real production. BTW you can use special service for stages https://teatro.io/ that will automate the whole process.
There is a syntax error in the file index.html.erb
<% form_for is give it should be
<%= form_for
With rails4 you must specify the parameters that are being saved.
BTW http://teatro.io/ will help you test it
Using status respond to the error is better for others system knows what is happeing
You could also check out my gem 'attr_searchable'
https://github.com/mrkamel/attr_searchable
which adds support for search engine like queries to ActiveRecord models and can exploit fulltext indices for mysql/postgres.
Did you get this working? I am seeing the same issue.
I've been getting "undefined method `fog_credentials=' for CarrierWave::Uploader::Base:Class" every time I tried to run rake db:reset or rails s. Could anyone please help?
You are correct, update_all is called once for each faq item, which results in a separate query for each faq item. The performance gain is because update_all updates the order field in a single query as opposed to first loading the model then doing an update in a separate query.
This still works in Rails 4 by the way, but the syntax is a little different:
Me three!
This doesn't work.
Just what I've thought while watching this episode and what I was wondering of. Thanks, Mario
Chock full of goodness. This pulled together a lot of concepts. One of my favs so far!
Thanks! I had the same problem!
I believe you will still need to run
rails server
in another terminal windowI keep getting a Missing Template error when I hit send. I'm using the chatter-before straight out of the box. Any clue what's going on?
Template is missing
Missing template messages/create, application/create with {:handlers=>[:erb, :builder, :coffee], :formats=>[:html], :locale=>[:en, :en]}. Searched in: * "/Users/stevenspiel/sites/chatter/chatter-before/app/views"
+1
Works like a charm! Thanks!
How can I send this pdf to various email address. Please please help me.
Have anybody tried to test this with Capybara?
I keep getting JSON invalid when testing it (using AJAX approach). Works fine in development though....
Please note the new ActiveModel::Model available in Rails 4 which makes it much easier to create a tableless model. In fact, the code shown in this screencast for the model doesn't actually work fully with Rails 4 presumably because of this change (at least it didn't work for me). For info, see: http://blog.plataformatec.com.br/2012/03/barebone-models-to-use-with-actionpack-in-rails-4-0/
I'm brand new to Rails and am having an issue with my routing once I fill out the Sign up form and click Save User.
I'm getting a Routing Error that reads "No route matches [POST] "/signup" "
rake routes returns this:
What am I missing?
I would add
entry.$update()
after "entry.winner = false" to persist the action
Instead of curl -I I advise curl -v. The curl -I could change the server behaviour like in case of grape based apis.
Would it be possible to use this with nested items?
IE I have a view setup with many Todo Lists and I'd like to be able to add Todo Items under those lists dynamically. (basically how a todo list works at Basecamp)
I have the proper associations taken care of, so I can add Todo Items to Todo Lists via the HTML form, but can't figure out how to pass the
todo_list_id
through jquery to use the remote option.+1 , this happened to me..good point !
HI Karthik,
I have the same issue, did you figure out why its happening ? when i put "production.foo.com" in url...it shows the same message as yours. Please help !
THIS GEM DOES NOT WORK WITH RAILS 4. Don't even try it. The employee who made it formerly worked for Twitter, then left Twitter, and no one else on the team is interested in supporting it. Recommend the Thumbs Up gem. https://github.com/bouchard/thumbs_up
Is it possible to change the default line separator from newline '\n' or '\r\n' to some other character, e.g '|' while parsing csv