[Rails] Re: Any way to get all records from a partial into a JavaScript array to test?

2011-07-22 Thread Bob Smith
The problem with putting this in the controller is that there isn't a chosen person to add the name to until someone asks the person which birthday is theirs from the list and selects the correct radio_button. The class in the radio button worked perfectly, but now the elm.down statements are the

Re: [Rails] Rails 3.1 CoffeeScript not working

2011-07-22 Thread Martin Wawrusch
Try $ -> $('#events a').lightBox() $("#slider").easySlider auto: true continuous: true There is an online js to coffeescript converter out there, I just can't find the link right now too. On Fri, Jul 22, 2011 at 9:19 PM, Tomas R. wrote: > I convert my old JS files into Coffee

[Rails] Rails 3.1 CoffeeScript not working

2011-07-22 Thread Tomas R.
I convert my old JS files into CoffeeScript, In my public controller I used this functions $('#events a').lightBox() $(document).ready -> $("#slider").easySlider auto: true, continuous: true they load inside application.js like this (function() { $('#events a').lightBox(); $(docu

[Rails] Creating a Universal Controller - Here's an example for anyone.

2011-07-22 Thread Alpha Blue
I'm sure there are some solid ideas out there for designing universal controllers, but I wanted to share my design which seems to work well. I'll post all the code on gist.github.com for reading. Here is the code: https://gist.github.com/1100923 => example_controller.rb I call a set_tables befo

[Rails] Re: RoR for a front end web designer

2011-07-22 Thread Alpha Blue
biofob...@gmail.com wrote in post #1012427: > I am a designer guy not a programmer. My coding skills are html, css > and some jquery tweaks to suit my needs, but i come to a point where i > think i need to learn a real language. What i'm doing now is working > with Textpattern or Wordpress(but i do

[Rails] Re: Newbie designing Rails app practices

2011-07-22 Thread Alpha Blue
You will always start with an idea, whether it be a forum, a blog, an e-commerce site, a social site, or other. Here are my tips for solid design work: 1. Sketch the idea out on paper and gain an idea of what core features you want to incorporate into your app. Think about authentication, a

[Rails] Re: Re: Active Record Issue (I think)

2011-07-22 Thread Rob Gu
Hassan Schroeder wrote in post #1012513: > On Fri, Jul 22, 2011 at 4:28 PM, Rob Gu wrote: >> Ok thanks guys for the great advice, that is almost certainly the issue >> (creating users and microposts, then deleting the original user etc..) > > Regardless of DB, remember you can handle situations li

Re: [Rails] Re: Active Record Issue (I think)

2011-07-22 Thread Hassan Schroeder
On Fri, Jul 22, 2011 at 4:28 PM, Rob Gu wrote: > Ok thanks guys for the great advice, that is almost certainly the issue > (creating users and microposts, then deleting the original user etc..) Regardless of DB, remember you can handle situations like this using e.g. :dependent => :destroy on an

[Rails] Newbie designing Rails app practices

2011-07-22 Thread MC
I'm trying to understand the best procedure for developing a Rails app. How do most of you do it? Do you start with an idea, like how a single page of the app should appear, and then build out that view with controllers, models, view, etc? In other words, should everything be built from what each v

[Rails] Re: Active Record Issue (I think)

2011-07-22 Thread Rob Gu
Ok thanks guys for the great advice, that is almost certainly the issue (creating users and microposts, then deleting the original user etc..) I was actually planning to start messing with MySQL so I'll look into SequelPro. Again thank you everyone! flyVing -- Posted via http://www.ruby-foru

[Rails] Re: URL validation regexp pattern

2011-07-22 Thread Dominic Rose
Here is my way to handle URL (in the file) Attachments: http://www.ruby-forum.com/attachment/6443/url_pattern.rb -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send ema

[Rails] Re: RoR for a front end web designer

2011-07-22 Thread jiblethead
On Jul 22, 2:48 pm, Hassan Schroeder wrote: > And I'd say you don't even need to be a super programmer; I personally > would love to find a designer for collaborations who understands Rails > enough to work directly in views, instead of me having to translate some > god-awful Dreamweaver mockup in

Re: [Rails] RoR for a front end web designer

2011-07-22 Thread Hassan Schroeder
On Fri, Jul 22, 2011 at 2:06 AM, biofob...@gmail.com wrote: > I am a designer guy not a programmer. > So my question is: is RoR viable for me or is to overwhelming. I would certainly say that if you're going to move into programming, RoR is a good choice. Ruby is very expressive, and there's a

[Rails] Re: RoR for a front end web designer

2011-07-22 Thread jiblethead
On Jul 22, 5:06 am, "biofob...@gmail.com" wrote: > I am a designer guy not a programmer. My coding skills are html, css > and some jquery tweaks to suit my needs, but i come to a point where i > think i need to learn a real language. What i'm doing now is working > with Textpattern or Wordpress(b

[Rails] Re: RoR for a front end web designer

2011-07-22 Thread 7stud --
biofob...@gmail.com wrote in post #1012427: > I am a designer guy not a programmer. My coding skills are html, css > and some jquery tweaks to suit my needs, but i come to a point where i > think i need to learn a real language. What i'm doing now is working > with Textpattern or Wordpress(but i do

Re: [Rails] errors building rails app

2011-07-22 Thread Kendall Gifford
On Friday, July 22, 2011 2:44:12 PM UTC-6, Rajinder Yadav wrote: > > opps! you're right Kendall =) ... I feel like a Rails noob =) Happens to everyone ;-) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the w

Re: [Rails] errors building rails app

2011-07-22 Thread Dev Guy
opps! you're right Kendall =) ... I feel like a Rails noob =) On Fri, Jul 22, 2011 at 4:20 PM, Kendall Gifford wrote: > > > On Thursday, July 21, 2011 11:14:03 PM UTC-6, Rajinder Yadav wrote: >> >> $ rails g scaffold title:string description:test >> >>        invoke  active_record >> >> /usr/loca

Re: [Rails] errors building rails app

2011-07-22 Thread Kendall Gifford
On Thursday, July 21, 2011 11:14:03 PM UTC-6, Rajinder Yadav wrote: > > $ rails g scaffold title:string description:test > >invoke active_record > /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/generators/base.rb:266:in > > > `const_defined?': wrong constant name Title:st

[Rails] Re: ActiveSupport not including i18n?

2011-07-22 Thread Kendall Gifford
On Friday, July 22, 2011 1:09:53 PM UTC-6, softwaregravy wrote: > > Went to use ActiveSupport in a gem today and got an error on account of not > having i18n installed. Either bundler should be installing i18n along with > activesupport or docs need to be updated. > > > quick repro: https://git

[Rails] Re: rails mailer and attachments

2011-07-22 Thread Kendall Gifford
On Friday, July 22, 2011 5:27:18 AM UTC-6, Ruby-Forum.com User wrote: > > i got a problem with rails achtionmailer 3.0.7. > > when i send a email with attachment, sometimes the attachment is not > displayed as such and is not be found in the email, but the size of the > email is still big (as with

[Rails] ActiveSupport not including i18n?

2011-07-22 Thread John Hinnegan
Went to use ActiveSupport in a gem today and got an error on account of not having i18n installed. Either bundler should be installing i18n along with activesupport or docs need to be updated. quick repro: https://github.com/softwaregravy/repro_active_support_i18n bundle exec irb require 'activ

[Rails] Re: STI joins

2011-07-22 Thread Kendall Gifford
On Friday, July 22, 2011 7:12:07 AM UTC-6, Juan Alvarado wrote: > > I have 2 models set up using single table inheritance (STI) with belongs_to > relationships to a third model. > > class CoveredEntity < Entity > belongs_to :breach > ... > end > > class BusinessAssociate < Entity > belongs_to :b

Re: [Rails] Design question

2011-07-22 Thread Piter Fcbk
First than all I want to thanks you for the help, really appreciate it. I have a question regarding the solution proposed. I also have a unique key in the database in order to avoid race conditions. That is the reason for which I was thinking on setting nil when an blank String is set, probably sh

[Rails] Re: Rails JS best practices? (jQuery + Prototype / MooTools

2011-07-22 Thread Alexey Petrushin
Here's an interesting solution how to add all methods of underscore.js to native types // Underscore methods that we want to implement on Array. var methods = ['each', 'map', 'reduce', 'reduceRight', 'detect', 'select', 'reject', 'all', 'any', 'include', 'invoke', 'pluck', 'max', 'mi

Re: [Rails] Re: Active Record Issue (I think)

2011-07-22 Thread Leigh Daniels
I occasionally forget that I deleted some record and am puzzled why something isn't working. I am using MySQL and I find that it's helpful to have an easy way to look at the specifics of what's in the database so I keep SequelPro () running. Then I can see what the PK

[Rails] Re: matching roll_no then loop 3 times, next loop..

2011-07-22 Thread Joachim Cheng
Hi, everyone. I have solved this problem by myself. Thank you for Frederick Cheung guide me.. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-tal

Re: [Rails] Design question

2011-07-22 Thread Fernando Almeida
Excuse me, i dont remembered the exact syntax. I looked my code now, i use that way :if => proc {|r| !r['email'].blank?} Thanks Tom. 2011/7/22 Tom Meinlschmidt > > this is wrong > > as in > > validates_uniqueness_of :email, :if => proc {|email| !email.blank? } > > the |email| in proc will re

Re: [Rails] Design question

2011-07-22 Thread Tom Meinlschmidt
this is wrong as in > validates_uniqueness_of :email, :if => proc {|email| !email.blank? } the |email| in proc will return object of record (not the attribute), so you hav eto use :if => proc {|r| !r.email.blank?} tom On Jul 22, 2011, at 17:39 , Fernando Almeida wrote: > You can use > valida

Re: [Rails] Design question

2011-07-22 Thread Fernando Almeida
You can use validates_uniqueness_of :email, :if => proc {|email| !email.blank? } Search for conditional validations for more info. 2011/7/22 Piter Fcbk > I have a model with a non obligatory field that must be unique. The code > looks like this: > > class Person < ActiveRecord::Base > ... >

Re: [Rails] Re: accepts_nested_attributes_for doesn't show output

2011-07-22 Thread Jen
Hi, list. Thanks for the help, nested forms working now. Cheers, Jen! On 21/07/11 15:54, Juan Alvarado wrote: On Jul 21, 2011, at 10:49 AM, Jen wrote: Hi, After getting nowhere I decided to follow this article: http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attribu

Re: [Rails] RoR for a front end web designer

2011-07-22 Thread John Feminella
> Books are great, I would add to your list Tobie Fernandez's The Rails 3 Way. Just a small correction here: the author is "Obie Fernandez". ~ jf -- John Feminella Principal Consultant, BitsBuilder LI: http://www.linkedin.com/in/johnxf SO: http://stackoverflow.com/users/75170/ On Fri, Jul 22,

[Rails] Design question

2011-07-22 Thread Piter Fcbk
I have a model with a non obligatory field that must be unique. The code looks like this: class Person < ActiveRecord::Base ... validates :email, :uniqueness => { :case_sensitive => false }, :length => { :maximum => 128 }, :email_format => true, :allow_nil => true ... end Wh

Re: [Rails] RoR for a front end web designer

2011-07-22 Thread Walter Lee Davis
On Jul 22, 2011, at 5:06 AM, biofob...@gmail.com wrote: I am a designer guy not a programmer. My coding skills are html, css and some jquery tweaks to suit my needs, but i come to a point where i think i need to learn a real language. What i'm doing now is working with Textpattern or Wordpress(

[Rails] Re: Active Record Issue (I think)

2011-07-22 Thread Frederick Cheung
On Jul 22, 9:56 am, Rob Gu wrote: > "User.first.id" returns "3", I guess I did some edit/deletes. > > "Micropost.first.user" returns "nil". > "Micropost.first.user_id" returns "1" oddly enough. > > Interesting, but what I don't get, is "User.first" selects the first > user (regardless of their i

[Rails] RoR for a front end web designer

2011-07-22 Thread biofob...@gmail.com
I am a designer guy not a programmer. My coding skills are html, css and some jquery tweaks to suit my needs, but i come to a point where i think i need to learn a real language. What i'm doing now is working with Textpattern or Wordpress(but i dont really like it) when i need some dynamic web site

[Rails] couchrest_model in Heroku Cloudant

2011-07-22 Thread Saulo Brust
How can I configure couchrest_model YML for Heroku Cloudant? https://github.com/couchrest/couchrest_model/blob/master/lib/rails/generators/couchrest_model/config/templates/couchdb.yml Is it like that? production: protocol: host: "#{ENV['CLOUDANT_URL']}" port: prefix: testcouch suffix:

Re: [Rails] How to create carbon copy recipents (cc) in Action Mailer for rails version 2.3.8

2011-07-22 Thread Tom Meinlschmidt
http://railsapi.com/doc/rails-v2.3.8/classes/ActionMailer/Base.html On Jul 22, 2011, at 15:23 , Sasi wrote: > My application is devloped in rails -2.3.8 > > i able to send mail to a single recipent. > > recipients 'ssasidara...@gmail.com' > > from @admin_name > subject sub > body:cid =>

[Rails] Re: complex form problem

2011-07-22 Thread Angelo Cordova
The source code is in the example,(http://guides.rubyonrails.org/ form_helpers.html#building-complex-forms the example of Handle Multiple Models in One Form from Advanced Rails Recipes ) I wanted to test that example by myself... that's why I didn't wrote any line of code and yes, the call @projec

[Rails] How to create carbon copy recipents (cc) in Action Mailer for rails version 2.3.8

2011-07-22 Thread Sasi
My application is devloped in rails -2.3.8 i able to send mail to a single recipent. recipients 'ssasidara...@gmail.com' from @admin_name subject sub body:cid => @cid, :name => user_detail.name , :addressing => @addressing , :admin_email => @admin_email, :admin_name => @admin_name c

[Rails] STI joins

2011-07-22 Thread Juan Alvarado
I have 2 models set up using single table inheritance (STI) with belongs_to relationships to a third model. class CoveredEntity < Entity belongs_to :breach ... end class BusinessAssociate < Entity belongs_to :breach ... end class Breach < Active

Re: [Rails] Re: please help me to complete this task how i start?

2011-07-22 Thread Dhaval Mehta
ok thank you... On Fri, Jul 22, 2011 at 4:56 PM, Michael Pavling wrote: > On 22 July 2011 10:52, Dhaval M. wrote: > >> No its not paid assignment.. its jst a task.. >> can u please tell me step by step from where i should start.. >> Thankx.. >> >> > I suggest you revise all the course material

[Rails] rails mailer and attachments

2011-07-22 Thread Damien Knight
i got a problem with rails achtionmailer 3.0.7. when i send a email with attachment, sometimes the attachment is not displayed as such and is not be found in the email, but the size of the email is still big (as with attachment). it's probably hidden base64 encoded in the sourcecode. now the hard

Re: [Rails] Re: please help me to complete this task how i start?

2011-07-22 Thread Michael Pavling
On 22 July 2011 10:52, Dhaval M. wrote: > No its not paid assignment.. its jst a task.. > can u please tell me step by step from where i should start.. > Thankx.. > > I suggest you revise all the course material you have been given, and read all your notes. Then start working on the problem. If y

Re: [Rails] Re: Any way to get all records from a partial into a JavaScript array to test?

2011-07-22 Thread Walter Lee Davis
On Jul 22, 2011, at 3:25 AM, Bob Smith wrote: The purpose of this button is to make it easy to change the way my app stores names. The old way was with a first and last name for the whole family, with the sex and birthdays of all family members later. Now I'm trying to connect the names and bir

[Rails] Re: rails3 tutorial: testing with factories

2011-07-22 Thread 7stud --
Well, I guess I overlooked this statement at the beginning of the section: === We’ll accomplish this goal with a user factory, which is a convenient way to define a user object and insert it into our test database. === So calling the factory like this: @user = Facotory(:user) does two things:

[Rails] rails3 tutorial: testing with factories

2011-07-22 Thread 7stud --
I'm having trouble understanding what the assigns() method does, as described at the following link: http://ruby.railstutorial.org/chapters/modeling-and-viewing-users-two#sec:better_user_views The User model has been 'rake db:test:prepare'ed, but I checked and no records were copied to the test d

Re: [Rails] complex form problem

2011-07-22 Thread Chris Kottom
You didn't include any source code, and without that, no one is going to be able to tell you for sure what you're doing wrong. The output here indicates that the @project reference isn't being initialized. Is there actually a call like @project = Project.new(...) in the action method? If this tu

[Rails] Re: please help me to complete this task how i start?

2011-07-22 Thread Dhaval M.
bertly_the_coder wrote in post #1011681: > rails new > > Your models are all off, especially if using STI. The user model > should cover all users. Use a column to differentiate between admin, > Employee...etc. Product is another model with a purchased flag and > documents is a third model. > > Us

[Rails] Re: please help me to complete this task how i start?

2011-07-22 Thread Dhaval M.
Michael Pavling wrote in post #1011668: > On 19 July 2011 12:05, Dhaval Mehta <2010dha...@gmail.com> wrote: > >> There is Company which builds products(Consider this company a >> software company). >> > > > This reads suspiciously like a homework/assignment question... Yes its task for me.. -- P

[Rails] Re: Active Record Issue (I think)

2011-07-22 Thread Rob Gu
I got confused since when I went to (localhost)/microposts, it showed me the list of microposts with a "User" column with values of 1's and 2's (I have two users), but in actuality their id's are 3 an 5 respectively, so I'm not sure why there is a discrepancy. -- Posted via http://www.ruby-for

[Rails] Re: Active Record Issue (I think)

2011-07-22 Thread Rob Gu
"User.first.id" returns "3", I guess I did some edit/deletes. "Micropost.first.user" returns "nil". "Micropost.first.user_id" returns "1" oddly enough. Interesting, but what I don't get, is "User.first" selects the first user (regardless of their id). So "User.first.microposts" should give me

Re: [Rails] Active Record Issue (I think)

2011-07-22 Thread Michael Pavling
On 22 July 2011 09:05, Curtis Schofield wrote: > On Jul 22, 2011, at 1:02 AM, Rob Gu wrote: > > If I do something like: > > "first_user = User.first" > > Then: > > "first_user.microposts" - should return a hash of the first user's > > microposts, but it just returns empty. > > > > what is User.fi

Re: [Rails] Active Record Issue (I think)

2011-07-22 Thread Curtis Schofield
On Jul 22, 2011, at 1:02 AM, Rob Gu wrote: > I'm following a rails tutorial (Hartl) and it's been fine so far, but > something doesn't seem to be working right. > > I have two basic models so far, "User" and "Micropost". > > class User < ActiveRecord::Base > has_many :microposts > end > > cla

[Rails] Active Record Issue (I think)

2011-07-22 Thread Rob Gu
I'm following a rails tutorial (Hartl) and it's been fine so far, but something doesn't seem to be working right. I have two basic models so far, "User" and "Micropost". class User < ActiveRecord::Base has_many :microposts end class Micropost < ActiveRecord::Base belongs_to :user end If I

Re: [Rails] Serialize Nested Hash Problem!

2011-07-22 Thread cipher_neo
that could well be the case. I will revert the code and try rename it. I'll get back with results, thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonra

[Rails] Re: Any way to get all records from a partial into a JavaScript array to test?

2011-07-22 Thread Bob Smith
The purpose of this button is to make it easy to change the way my app stores names. The old way was with a first and last name for the whole family, with the sex and birthdays of all family members later. Now I'm trying to connect the names and birthdays, so any person in the family that has their