Re: [Rails] Re: exception handling not working?

2011-10-25 Thread Rajinder Yadav
On 11-10-25 11:56 AM, Jeffrey L. Taylor wrote: Plain "rescue" just catches exceptions derived from the StandardError class. IIRC, "rescue Exception" will catch everything. HTH, Jeffrey This still does not fix the error, the exception goes unhandled then webrick crashes on the next server

Re: [Rails] Social Networking

2011-10-25 Thread kausik bakshi
On Fri, Jun 24, 2011 at 11:22 PM, exelstu...@gmail.com wrote: > Try some of these: > > https://github.com/insoshi/insoshi#readme > > http://communityengine.org/ > > http://lovdbyless.com/ > > http://www.enginey.com/ > > Lovd by Less looks pretty good, haven’t had a chance to try it yet tho. > >

Re: [Rails] Social Networking

2011-10-25 Thread exelstu...@gmail.com
Try some of these: https://github.com/insoshi/insoshi#readme http://communityengine.org/ http://lovdbyless.com/ http://www.enginey.com/ Lovd by Less looks pretty good, haven¹t had a chance to try it yet tho. Best, Pardeep. On 6/23/11 11:16 PM, "Sayuj Othayoth" wrote: > Hi, > > I want to c

Re: [Rails] help! is this activerecord modelling anywhere near correct/optimal?

2011-10-25 Thread Colin Law
On 25 October 2011 13:40, sig wrote: > I'm a n00b & need help with getting some active record modelling > right. > > i've tried to read up and have experimented a lot with varaible in the > console & I *think* i'm getting it, but this is my first rails project > and would really appreciate some wi

[Rails] Re: undefined method `all' for MyModel:Module

2011-10-25 Thread tspore
Thank you very much for helping me think through this. Its a old project, where upgrading it is going to be a couple week process. On Oct 24, 11:44 pm, Frederick Cheung wrote: > On Oct 24, 10:20 pm,tspore wrote: > > > What I'm thinking is that my application is called the same name as > > MyModel

[Rails] help! is this activerecord modelling anywhere near correct/optimal?

2011-10-25 Thread sig
I'm a n00b & need help with getting some active record modelling right. i've tried to read up and have experimented a lot with varaible in the console & I *think* i'm getting it, but this is my first rails project and would really appreciate some wisened feedback from experts :) this is my attemp

[Rails] Sprocket Digest + Debug combination broken?

2011-10-25 Thread Christoffer Klang
Hi all, we're just in the process of upgrading to the new asset pipeline, but I'm having an annoying issue with Sprockets. It turns out that I can't enable both *debug* and *digest* in development mode. When I do, I get a Errno::ENAMETOOLONG because the digest becomes the *entire* *content* of

[Rails] advice on updating gems

2011-10-25 Thread Michael Baldock
I've just been battling with a deployment to heroku. The error that stopped me for ages was "You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. Using bundle exec may solve this." I eventually managed to solve this by uninstaling rake 0.9.2 adding rake 0.9.2.2 to my ge

[Rails] Re: ActiveRecord::ConnectionNotEstablished

2011-10-25 Thread Farnaz Bakhtari
I have the exact same problem in chapter 3. I went over everything that I could think can go wrong but wasn't successful. This is my github directory : https://github.com/justfarnaz/sample_app Really appreciate the help Max. -- Posted via http://www.ruby-forum.com/. -- You received this messa

Re: [Rails] Separate DB with rails 3 and mysql

2011-10-25 Thread Colin Law
On 25 October 2011 17:21, Ivan Zagorodniy wrote: > Hi guys, > > We have two RoR projects with some similar data in DB let's say DB "A" > and  DB "B". > My task is to store all similar tables with data in one DB - the "C" DB, > plus remove unnecessary > tables from "A", "B". Would not a simpler so

[Rails] Re: Customizing errors

2011-10-25 Thread Tim Shaffer
error.full_messages does indeed call human_attribute_name. Did you check the source for that method in the link you posted? http://ar.rubyonrails.org/classes/ActiveRecord/Errors.html#M000311 full_messages << @base.class.human_attribute_name(attr) + " " + msg -- You received this message becaus

Re: [Rails] Date formats

2011-10-25 Thread Scott Ribe
On Oct 25, 2011, at 11:50 AM, Tom Allison wrote: > timestamp with time zone Which means that it is offset by postgres to/from the time zone of the client making the query, your rails app in this case. Timestamp without time zone makes no adjustments, just storing/retrieving it as supplied. --

Re: [Rails] Date formats

2011-10-25 Thread Tom Allison
OK, so the default time saved is UTF-8. Which means that storing it a what appears to be now+4 hours is correct. I think my question falls into a postgresql question. When I query these fields it appears as the time (16:00 instead of 12:00) is identified as "timestamp with time zone" -- unexpected.

Re: [Rails] Date formats

2011-10-25 Thread Philip Hallstrom
> Just realized I have a nice problem. > > using Postgresql... > > When I save something via Rails to the table it's saved with a GMT > offset (so 12:00 becomes 16:00) > But the database is configured to save everything as GMT. > > Which means -- when I query it via SQL it's coming back as now +

Re: [Rails] migration and updating database

2011-10-25 Thread Peter Vandenabeele
On Tue, Oct 25, 2011 at 2:23 PM, fadwa ferodia wrote: > Hi, > I have an application using ruby on rails 3 (rubystack). I'm on windows > vista > I want to update the database and here is what I get after typing rake > db:seed --trace > > (in C:/Users/dell/BitNami RubyStack Development projects/ser

[Rails] Date formats

2011-10-25 Thread Tom Allison
Just realized I have a nice problem. using Postgresql... When I save something via Rails to the table it's saved with a GMT offset (so 12:00 becomes 16:00) But the database is configured to save everything as GMT. Which means -- when I query it via SQL it's coming back as now + 4 hours instead o

[Rails] Re: additional model attributes

2011-10-25 Thread Jeff Lewis
One alternative in terms of dynamically adding an attribute to a model instance (without having to have pre-defined any attr_... in the class): ... place = Place.new place.name = place.name place.id = place.id place['address'] = external_api_place_data.address ... >From then on, for t

[Rails] Separate DB with rails 3 and mysql

2011-10-25 Thread Ivan Zagorodniy
Hi guys, We have two RoR projects with some similar data in DB let's say DB "A" and DB "B". My task is to store all similar tables with data in one DB - the "C" DB, plus remove unnecessary tables from "A", "B". I want to find the best way how to do it. The goal is to get the same or better perfo

Re: [Rails] Re: exception handling not working?

2011-10-25 Thread Jeffrey L. Taylor
Plain "rescue" just catches exceptions derived from the StandardError class. IIRC, "rescue Exception" will catch everything. HTH, Jeffrey Quoting Rajinder Yadav : > OK I figured out this is a bug with webbrick, it errors out and then > crashes! > > I installed passenger + nginx and the code wo

Re: [Rails] Delete all cache

2011-10-25 Thread Jeffrey L. Taylor
Quoting Luk Mus : > Is it possible to delete all rails cache? how? > 'rake tmp:clear' doesn't work. > > config/envinroments/production.rb: > ... > config.cache_store =:file_store, 'tmp/cache/' > ... > Try restarting the Rails server, Webrick, Apache, whatever. HTH, Jeffrey -- You received t

Re: [Rails] Re: exception handling not working?

2011-10-25 Thread Rajinder Yadav
On 11-10-25 11:30 AM, Peter Vandenabeele wrote: On Tue, Oct 25, 2011 at 5:20 PM, Rajinder Yadav wrote: OK I figured out this is a bug with webbrick, it errors out and then crashes! I installed passenger + nginx and the code works as expected. But not optimal I think. If you replaced the li

Re: [Rails] Re: exception handling not working?

2011-10-25 Thread Peter Vandenabeele
On Tue, Oct 25, 2011 at 5:20 PM, Rajinder Yadav wrote: > OK I figured out this is a bug with webbrick, it errors out and then > crashes! > > I installed passenger + nginx and the code works as expected. > But not optimal I think. If you replaced the lines rescue # SQLite3::ConstraintExce

Re: [Rails] Re: additional model attributes

2011-10-25 Thread Frederick Cheung
On 25 Oct 2011, at 16:00, "Lukas M." wrote: > hm.. no luck with that either. when i try to print out the places object > in the console (logger.debug @place.to_yaml), "address" is missing. For json at least you could override the as_json method to add the attributes you want. Fred > > --

Re: [Rails] Re: additional model attributes

2011-10-25 Thread Peter Vandenabeele
On Tue, Oct 25, 2011 at 5:00 PM, Lukas M. wrote: > hm.. no luck with that either. when i try to print out the places object > in the console (logger.debug @place.to_yaml), "address" is missing. > >From the top of my head (not hard tested now). Now you refer to to_yaml, in previous mails, you r

[Rails] Re: exception handling not working?

2011-10-25 Thread Rajinder Yadav
OK I figured out this is a bug with webbrick, it errors out and then crashes! I installed passenger + nginx and the code works as expected. Rajinder On 11-10-25 08:29 AM, Rajinder Yadav wrote: I am playing with Rails 3.1.1 and made a simple blog app. I created a unique index on a field and w

[Rails] Re: additional model attributes

2011-10-25 Thread Lukas M.
hm.. no luck with that either. when i try to print out the places object in the console (logger.debug @place.to_yaml), "address" is missing. -- 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

[Rails] Re: additional model attributes

2011-10-25 Thread Tim Shaffer
I think for Rails to recognize that the attribute should be included, you need to use attr_accessible rather than the Ruby method attr_accessor. -- 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 ht

[Rails] Customizing errors

2011-10-25 Thread iGbanam
Hello fellow Rails devs, I had a slight problem with validation messages. I had a Post AR model that has an :author_name attribute. Now if a validation goes wrong, I would like the message to say: "Name of author can't be blank" as opposed to "author name can't be blank". I have tried looking in

Re: [Rails] RVM

2011-10-25 Thread Jesse Cravens
This may help: http://jessecravens.com/09262011/rvm-ruby-version-manager-and-ruby-rails On Mon, Oct 24, 2011 at 1:17 PM, Gethernm wrote: > I wanted to know if i should use RVM? I have been using rails more and > more and more now and am looking to keep ruby and ruby gems better > together. Is it

[Rails] Re: additional model attributes

2011-10-25 Thread Lukas M.
hi, that works but not in the case when i would like to do something like this: user_place = Location.new(:place => place, :user => user) user_place.to_json //address is missing -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google G

Re: [Rails] Re: gdocs4ruby cannot work

2011-10-25 Thread Everaldo Gomes
Hi! I was looking at your error message and I saw: >403.4 SSL required I don't know how to solve, but it looks like with a SSL problem. Best Regards, Everaldo On Tue, Oct 25, 2011 at 10:55 AM, Kausik Bakshi wrote: > hi > Everaldo > > Actually this error is happen due to some other reason > >

Re: [Rails] additional model attributes

2011-10-25 Thread Frederick Cheung
On 25 Oct 2011, at 14:03, "Lukas M." wrote: > Hi, > i have a "place" model with 2 columns (id, name). > I'm calling an external api which gives me data to create a new place > object. > > I would like to add the address from the external place to the place > object and render it as a json resu

[Rails] additional model attributes

2011-10-25 Thread Lukas M.
Hi, i have a "place" model with 2 columns (id, name). I'm calling an external api which gives me data to create a new place object. I would like to add the address from the external place to the place object and render it as a json result, without storing it in the database. i don't get any error

[Rails] Re: gdocs4ruby cannot work

2011-10-25 Thread Kausik Bakshi
hi Everaldo Actually this error is happen due to some other reason service.filesworking correctly but when I try to execute : service.folders it gets error: invalid response received: 403 GData4Ruby::HTTPRequestFailed: GDataServiceForbiddenException403.4 SSL required In previo

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread Sebastian
OK, it looks like that JRails is better for dealing with Rails2, but not for Rails3! So there is only one question left: If a install the "jquery-rails" gem like you mentioned, are the prototype helpers still working? Right now I am using your code in html tags and it is working like a charm, lik

Re: [Rails] gdocs4ruby cannot work

2011-10-25 Thread Everaldo Gomes
Hi! I think you should put "include GDocs4Ruby" inside your controller. Best Regards, Everaldo On Tue, Oct 25, 2011 at 10:32 AM, Kausik Bakshi wrote: > In previous I use gdocs4ruby to access Google document of my account > from outside the google. > > I used the code inside my controller: > > r

[Rails] gdocs4ruby cannot work

2011-10-25 Thread Kausik Bakshi
In previous I use gdocs4ruby to access Google document of my account from outside the google. I used the code inside my controller: require 'rubygems' require 'gdata' require 'gdocs4ruby' include GDocs4Ruby class DocumentController < ApplicationController def creat service = GDocs4Ruby::Servi

[Rails] migration and updating database

2011-10-25 Thread fadwa ferodia
Hi, I have an application using ruby on rails 3 (rubystack). I'm on windows vista I want to update the database and here is what I get after typing rake db:seed --trace (in C:/Users/dell/BitNami RubyStack Development projects/server) ** Invoke db:seed (first_time) ** Invoke db:abort_if_pending_mig

[Rails] exception handling not working?

2011-10-25 Thread Rajinder Yadav
I am playing with Rails 3.1.1 and made a simple blog app. I created a unique index on a field and when I submit a new post, it throws an exception if the field is not unique. I've added a rescue, but it's not doing anything? What am I doing wrong. def create @post = Post.new(params[:pos

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread Sebastian
Thank you for your detailed answer! I started with Rails 3, so there is no "old" Rails 2 code in it. As I know Rails 3 comes out-of-the-box configured with prototype, right? So yes I have prototype installed. And yes you are right I meant javascript helpers (not JAVA), like this: <%= button_to 'D

[Rails] Looking for brilliant RoR Developers to join our Team

2011-10-25 Thread Rizza ES
We specialize in Agile PHP and Ruby Development for our own in-house projects. You will be working on both Ruby and PHP projects as well as help out with System Admin for those projects. We believe that everyone on the team should have a similar base skill set (this way the System Admin knows what

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread radhames brito
> > > google to your Gemfile and at this > > should be 'move to your gem file', it appear i was making honor to my motto: cogito ergo google -- 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

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread radhames brito
On Tue, Oct 25, 2011 at 4:14 AM, Sebastian wrote: > Ah, I found my mistake!!! > > I was just only adding JQuery in my view with <%= > javascript_include_tag "http://code.jquery.com/jquery-latest.js"; %>, > but not in my application.html.erb. That means that the code in the > application.js had pro

Re: [Rails] Re: Display names

2011-10-25 Thread Colin Law
On 25 October 2011 11:24, 3quid wrote: > Thanks Colin. That solved it, although I swear I already tried to do > it like that! Use a version control system (probably git) for controlling your code, and commit often. Then you can always look back and see exactly what you have tried. Do experiment

Re: [Rails] RVM

2011-10-25 Thread Peter De Berdt
On 25 Oct 2011, at 09:49, Peter Vandenabeele wrote: I have been using rails more and more and more now and am looking to keep ruby and ruby gems better together. Is it worth using RVM? And what does it acually do other then able me to swtich between ruby 1.8 and 1.9? 2 important things it doe

[Rails] Re: Display names

2011-10-25 Thread 3quid
Thanks Colin. That solved it, although I swear I already tried to do it like that! Your help is much appreciated. On Oct 25, 7:52 am, Colin Law wrote: > On 24 October 2011 23:03, Graham Dawe wrote: > > > > > > > > > > > Philip Hallstrom wrote in post #1028174: > > >> :foreign_key > >> Specify t

[Rails] Re: Using Ruby on Rails in a Debian/non-Ubuntu Linux distro)

2011-10-25 Thread Xuan
I use it successfully in a Mint-Debian distro (which I highly recommend, since its quite lightweight and rolling released). The only problem I faced happened installing ruby 1.9.2 with rvm, but it's easily solved installing 1.8.2 first and running 'rvm use 1.8.2' before installing 1.9.2. On 24 o

[Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread Sebastian
Ah, I found my mistake!!! I was just only adding JQuery in my view with <%= javascript_include_tag "http://code.jquery.com/jquery-latest.js"; %>, but not in my application.html.erb. That means that the code in the application.js had propably no JQuery access! My problem now is that my other norma

Re: [Rails] RVM

2011-10-25 Thread Peter Vandenabeele
On Mon, Oct 24, 2011 at 8:17 PM, Gethernm wrote: > I wanted to know if i should use RVM? Yes. > I have been using rails more and > more and more now and am looking to keep ruby and ruby gems better > together. Is it worth using RVM? And what does it acually do other > then able me to swtich b

Re: [Rails] Re: How to transform my html form into a rails 3 form

2011-10-25 Thread Roy Situmorang
Well, could you paste your HTML code here? On Tue, Oct 25, 2011 at 1:58 PM, Sebastian wrote: > First, thank you all for your answers!!! > > I removed the typo and did what you told me! The firebug console is > finding the $(".show1") and it is hiding the row if I type $ > (".show1") .hide() > > S

Re: [Rails] Delete all cache

2011-10-25 Thread Colin Law
On 25 October 2011 05:46, Luk Mus wrote: > Is it possible to delete all rails cache? how? > 'rake tmp:clear' doesn't work. > > config/envinroments/production.rb: > ... > config.cache_store =:file_store, 'tmp/cache/' > ... > > tmp/cache is empty, but page is still cached. Are you sure it is not yo