Re: [Rails] Comment has_many comments

2013-01-18 Thread Colin Law
On 17 January 2013 18:32, Роман Пружанский 19pr...@gmail.com wrote: Hi, I want to create web application where people can discuss some things. There will be a Posts and users can comment it, but I also want users can comment commentaries. Can I create model comment, that belongs_to comment

[Rails] Unable to install em-synchrony gem

2013-01-18 Thread Mohnish J.
Hello, I'm trying to setup the gem environment for my app on prod. Apparently, I got to know that RVM is not recommended to be used in prod env. So, I'm doing a non RVM setup. I'm on Ruby 1.9.3 and Rails 3.0.11. When I run the `gem env` cmd from the terminal I get the below details. Please

[Rails] Order by with first_name and also last_name

2013-01-18 Thread keerthi priya
Hi all, hey I have need some info i have this def fullname #{first_name} #{last_name} end and i want alphabetical order with first name i can do it but along with first_name i want last_name in alphabetical order like James emi will come first before James fame can we do in rails

Re: [Rails] Order by with first_name and also last_name

2013-01-18 Thread Loganathan Sellapa
Model.all(:order = 'first_name DESC, last_name DESC') and then do the interpolation regards, Loganathan Mob: +91 7760780741 | +91 9944414388 Skype: loganathan.sellappa ViewMe http://vizualize.me/loganathan On Fri, Jan 18, 2013 at 4:43 PM, keerthi priya emailtokeerthipr...@gmail.com wrote:

[Rails] Re: Rspec Test Failing?

2013-01-18 Thread andreo
Hey fuzzy, I think the first thing that is maybe wrong with your spec is that you are trying to do a request inside of a describe. it should be something like: describe #update do before { put employee_path(employee) } it returns something or does something do specify { response.should

[Rails] redirect_to(session[:return_to]) vs session.delete

2013-01-18 Thread Alex M
Hey all, Recently I've been looking into on how to return back to a previous referring URL and and the most common approach is: redirect_to session[:return_to] But some recommend: redirect_to(session.delete(:return_to) || default) How I understand it, in the second example we call

[Rails] options_from_collection_for_select

2013-01-18 Thread Gerry Brown
I have just started using RoR and am creating some select boxes on my form with the following code: %= select_tag(options_from_collection_for_select(Owner.all, :id, :fname)) % My problem is that it does NOT return the first record from the table, but just the second and succeeding records. Does

Re: [Rails] Unable to install em-synchrony gem

2013-01-18 Thread Jordon Bedwell
You are using Debian-MRI (Debian-Ruby) you need to sudo before running gem install. If you want to install as a normal user use RVM or Chgems/Chruby. The hint was: ERROR: While executing gem ... (Gem::FilePermissionError) based on the username I'm going to also assume you are on AWS, which

Re: [Rails] redirect_to(session[:return_to]) vs session.delete

2013-01-18 Thread Jordon Bedwell
On Thu, Jan 17, 2013 at 7:37 PM, Alex M zap...@gmail.com wrote: Recently I've been looking into on how to return back to a previous referring URL and and the most common approach is: redirect_to session[:return_to] But some recommend: redirect_to(session.delete(:return_to) || default) How

Re: [Rails] options_from_collection_for_select

2013-01-18 Thread Colin Law
On 18 January 2013 12:19, Gerry Brown gerbreo...@gmail.com wrote: I have just started using RoR and am creating some select boxes on my form with the following code: %= select_tag(options_from_collection_for_select(Owner.all, :id, :fname)) % My problem is that it does NOT return the first

Re: [Rails] Re: Rspec Test Failing?

2013-01-18 Thread Mirri Kim
Hi, `specify` is actually just the same as `it`. It's just there because sometimes it reads better. See here: https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/example_group.rb#L82 - Mirri On Fri, Jan 18, 2013 at 5:22 PM, and...@benjamin.dk wrote: Hey fuzzy, I think the first

[Rails] Re: Rspec Test Failing?

2013-01-18 Thread fuzzy
Hi Andre, Thanks for your reply ... following is the authentication_pages_spec.rb file which now resides in the spec/ features folder ... all of the tests pass except three. require 'spec_helper' describe Authentication do subject { page } describe signin do

[Rails] Re: Rspec Test Failing?

2013-01-18 Thread fuzzy
Thanks Mirri for you post ... I had a look at the link ... are they saying that 'specify' has now been superceded by 'it'? On Jan 18, 10:17 am, Mirri Kim mirri@gmail.com wrote: Hi, `specify` is actually just the same as `it`. It's just there because sometimes it reads better. See

Re: [Rails] Re: Rspec Test Failing?

2013-01-18 Thread Mirri Kim
Nope, just an alias. On Sat, Jan 19, 2013 at 12:48 AM, fuzzy hlog...@gmail.com wrote: Thanks Mirri for you post ... I had a look at the link ... are they saying that 'specify' has now been superceded by 'it'? On Jan 18, 10:17 am, Mirri Kim mirri@gmail.com wrote: Hi, `specify` is

[Rails] Newbie: I just want to exclude two attributes when I call update_attributes

2013-01-18 Thread Don Schenck
I have two virtual attributes in my model. Let's call them hours_worked and minutes_worked. I use them to calculate work_time, which is an integer I store -- it's the total minutes worked (e.g. 3.5 hours is 210). I want :hours_worked and :minutes_worked to NEVER appear in the database. But

[Rails] PROBLEM WITH FCK EDITOR

2013-01-18 Thread saritha chakilala
HI ALL, 1. i am using fck editor in my application. 2. when i type any text in fck editor it was saved in hml format in database(i.e, mysql) 3. when i was try to retrieve the text it will displaying in html format not as plain text how to solve this problem???please