[Rails] Re: New to Ruby? Learn about Code blocks, Symbols and Syntactic Sugar

2014-02-19 Thread Wale Olaleye
It appears the opposite happened with Ruby, as we rarely use Semi-Colons! The point of the article is to point out Ruby features to reduce confusion for new Rubyist. -Wale On Wednesday, February 19, 2014 11:12:42 AM UTC-5, Rick wrote: > > This announcement surfaced back in the late seventies:

[Rails] Re: Ruby 2.0 / Rails 4 respond_to produces ActionController::UnknownFormat

2014-02-19 Thread Vell
I have traced this down to cucumber not knowing how to follow a javascript link. Or that my step definition is not setup correctly to following a javascript link. I decided to test that things were working as they should in the browser and they work as expected. So its something with using clic

[Rails] Ruby 2.0 / Rails 4 respond_to produces ActionController::UnknownFormat

2014-02-19 Thread Vell
Hello all, I am stumped by this issue I am having. I have created a new method in my routes file that I want to have accessible via javascript. Right now, I am getting the following error when I try to access the action: ActionController::UnknownFormat (ActionController::UnknownFormat Her

[Rails] Extending a module to models causes ArgumentError A copy of xx has been removed from module tree

2014-02-19 Thread Harsh Gupta
How can I extend a module to a model class and use an instance of a custom class as a class instance variable for model such that when next request comes, custom class could be found and older instances are deleted? I created a class Samples. I also created a module LoadSamples where in a method s

Re: [Rails] find email by account using active record

2014-02-19 Thread Hassan Schroeder
On Wed, Feb 19, 2014 at 11:21 AM, Bob Kendall wrote: > am trying to refactor an app that I have inherited that was not coded > using rails best practices. I am fairly new to rails and I am doing the > tutorials and book thing, but I also need to keep making process on the > project. Uh, well. Not

[Rails] find email by account using active record

2014-02-19 Thread Bob Kendall
am trying to refactor an app that I have inherited that was not coded using rails best practices. I am fairly new to rails and I am doing the tutorials and book thing, but I also need to keep making process on the project. I have a model th

Re: [Rails] Re: Re: Re: Re: CSS Reference Lost in Some Cases

2014-02-19 Thread mjenn
+1 on Ganesh's reply, but wondering why you are not simply using "<%= stylesheet_link_tag "application", media: "all" %>"? That way all stylesheets are picked up as long as you have them in the app/assets/stylesheets folder. Simply remove the stylesheets you don't want. On Tuesday, February

[Rails] Re: New to Ruby? Learn about Code blocks, Symbols and Syntactic Sugar

2014-02-19 Thread Rick
This announcement surfaced back in the late seventies: "*CAUTION*: *The Programmer General has advised that excessive use of Syntactic Sugar has been shown to lead to Hardening of the Semi-Colon*." It has never been retracted, as far as I know. On Wednesday, February 19, 2014 10:09:27 AM UTC-5,

[Rails] New to Ruby? Learn about Code blocks, Symbols and Syntactic Sugar

2014-02-19 Thread Wale Olaleye
A few months ago I wrote a post about Ruby Code blocks, Symbols and Syntactic Sugar. They serve as a gentle introduction to 3 interesting Ruby features. If you are coming from a different language, or a new to programming, I think you will find the post interesting. Feel free to leave a comment

[Rails] Re: I failed in C language , what about ruby on rails ??

2014-02-19 Thread Wale Olaleye
Don't give up. Try learning how to code on your own and see if that works. Create a real life problem that you want to solve, and code it with any language of your choice. Start with a small computational problem. Some people don't learn well in classes, so the fact that you failed a class may

[Rails] Re: Why does calling .delete_all on has_many relationship nullifies foreign keys.

2014-02-19 Thread Wale Olaleye
You should be using object.destroy and dependent: destroy in the model, instead of delete. Destroy is RESTful and will look to remove your dependent objects in the db, among other things. -Wale On Tuesday, February 18, 2014 2:38:35 AM UTC-5, marcin.r...@gmail.com wrote: > > I have several years

[Rails] Re: Why does calling .delete_all on has_many relationship nullifies foreign keys.

2014-02-19 Thread Robert Walker
unknown wrote in post #1137005: > Yes I know I can set :dependant => :delete_all > > but what's resoning behind this default behaviour? Is it just a legacy > stuff? > anyone knows why the default behaviour here is to nullify keys? Actually, the Rails documentation explains this rather clearly, so

Re: [Rails] Re: I failed in C language , what about ruby on rails ??

2014-02-19 Thread Felipe Carvalho
C, Python, Ruby, Java... it does not matter... Learn binary tree is part of the process of learning algorithms, logic concepts. Atc, *Felipe Carvalho* felipe.olivei...@gmail.com +55 61 9123 9264 On Wed, Feb 19, 2014 at 1:50 AM, Pinocchio wrote: > > 2014년 2월 18일 화요일 오후 7시 12분 31초 UTC+9, hayth

[Rails] Re: Why does calling .delete_all on has_many relationship nullifies foreign keys.

2014-02-19 Thread Adrien Siami
You're calling delete_all on an association, even if it's weird, for rails, deleting an association means only breaking the links between the models, not effectively destroying the records. Semantically, this makes sense, but I grant you that it's a bit counter intuitive. On Tuesday, February 1