Re: [Rails] Is there a serialization Example for Rails 3.0?

2011-04-14 Thread Andrew Miehs
Hi Fred, On 14/04/2011, at 11:38 PM, Frederick Cheung wrote: >> Unfortunately the form does not automagically re-insert the values after >> they are saved. I noticed other people commenting about the same feature. Is >> there a better way of doing this? >> > > You might try passing @switch.con

[Rails] How to convert this sql into named_scope

2011-04-14 Thread Batterhead
hi, i have a sql statement which has a subquery on itself. it gets all the unique invitees of a given event from table invitation. i came up with the sql but i don't know how to convert it into a named_scope which i can reuse in other places. please help. sql: select * from invitations inv join (

[Rails] Re: accepts_nested_attributes_for and _destroy not working (but no error messages)

2011-04-14 Thread skt
Couple things you can try - 1. Where you have _destroy="false" replace that with _destroy="0" - just in case something is throwing that parser out of whack 2. Try _delete instead of _destroy - been a while but I remember in one of my setups _delete worked but not _destroy -S On Apr 14, 10:42 pm,

[Rails] accepts_nested_attributes_for and _destroy not working (but no error messages)

2011-04-14 Thread Niklas Nson
I have a has_many association and does some adding throug a nested form, i can add objects (images) and edit text this works fine. But when i try to delete items nothing happens. This is what my log looks like: Started POST "/photosets/168" for 127.0.0.1 at Fri Apr 15 07:34:04 +0200 2011 Processi

[Rails] Re: Routing error with OmniAuth

2011-04-14 Thread skt
On Apr 14, 7:28 pm, Phil Crissman wrote: > Phil > > > > > > > > > > On Thu, Apr 14, 2011 at 6:29 PM, skt wrote: > > Hello, > > > I am trying to use OmniAuth with Devise and I am stumbling on some > > initial step. When I go to localhost:3000/auth/twitter I get a routing > > error > > > No route

[Rails] Re: thinking sphinx: query price> 0

2011-04-14 Thread pat
Sphinx doesn't have the concept of greater or less than for filters - not in a simple sense, anyway. The easiest approach is to have a range between 1000 and a really big number (given it's an integer, perhaps 2^32): Product.search :with => {:price => 1000..(2**32)} Give that a shot. -- Pat O

Re: [Rails] Routing error with OmniAuth

2011-04-14 Thread Phil Crissman
Phil On Thu, Apr 14, 2011 at 6:29 PM, skt wrote: > Hello, > > I am trying to use OmniAuth with Devise and I am stumbling on some > initial step. When I go to localhost:3000/auth/twitter I get a routing > error > > No route matches "/auth/twitter" > > I have the "gem omniauth" in my gemfile and

[Rails] Routing error with OmniAuth

2011-04-14 Thread skt
Hello, I am trying to use OmniAuth with Devise and I am stumbling on some initial step. When I go to localhost:3000/auth/twitter I get a routing error No route matches "/auth/twitter" I have the "gem omniauth" in my gemfile and I have omniauth.rb where I have setup twitter connection as below R

[Rails] Re: Rails 3 requires SQLite?

2011-04-14 Thread Lee
That did the trick -- thanks very much for the tip. On Apr 14, 2:31 pm, Frederick Cheung wrote: > On 14 Apr 2011, at 19:08, Lee wrote: > > > I've installed latest Rails on Centos 5.5, created a test app with > > "rails new test1", and changed the datatabase config in config/ > > database.yml to

[Rails] different date format in sqlite and mysql

2011-04-14 Thread Seb
created_at is stored differently in mysql then in sqlite. sqlite stores the dates like: 2011-04-14 22:52:52.758612 and mysql stores the date like: 2011-04-14 22:52:52 (possible rounded) When I output the date with json formatting, it's returned as 2011-04-14T22:52:52Z regardless of the underlayi

Re: [Rails] View helper, blocks and capture. Template output is repeated (rails 3)

2011-04-14 Thread Frederick Cheung
On 14 Apr 2011, at 23:26, christoffer wrote: > I'm having some issues with blocks and capture in erb templates, and > the particular problem shows itself in that the expected output in the > template view is repeated due to something related to how capture > works. (Using Rails 3.x) Here's my

[Rails] View helper, blocks and capture. Template output is repeated (rails 3)

2011-04-14 Thread christoffer
I'm having some issues with blocks and capture in erb templates, and the particular problem shows itself in that the expected output in the template view is repeated due to something related to how capture works. (Using Rails 3.x) I have the following view helper: module ColumnLayoutHelper de

Re: [Rails] a little problem with extJS & log in form

2011-04-14 Thread Frederick Cheung
On 14 Apr 2011, at 11:27, HelloRails wrote: > > Without extJS (login,js) everything looks nice. Sessions works and so > on. But i want make form in extJs, i made it, but when i put my right > data (user:test,pw:test) i get in console: > >Processing UserController#authenticate (for 127.0.0

Re: [Rails] Is there a serialization Example for Rails 3.0?

2011-04-14 Thread Frederick Cheung
On 14 Apr 2011, at 19:30, Andrew Miehs wrote: > Hi all, > > I am new to ruby and rails coming from a perl background. > > I was hoping someone could help point me to some sample code to serialize > data from a form. > My plan is to write a tiny app to generate Cisco switch configuration file

Re: [Rails] Rails 3 requires SQLite?

2011-04-14 Thread Frederick Cheung
On 14 Apr 2011, at 19:08, Lee wrote: > I've installed latest Rails on Centos 5.5, created a test app with > "rails new test1", and changed the datatabase config in config/ > database.yml to PostgreSQL. "rails server" fails because SQLite is > missing. Why is it looking for SQLite when database.

[Rails] RoR Lead - Southern FL

2011-04-14 Thread Jennifer Gandy
Ruby on Rails Lead Opportunity to join a fast growing and innovative development team as a Lead Ruby on Rails Developer in Southern, FL. We are looking for an energetic candidate who is passionate about development and is eager to help a growing team succeed. This role will be responsible for lead

[Rails] Is there a serialization Example for Rails 3.0?

2011-04-14 Thread Andrew Miehs
Hi all, I am new to ruby and rails coming from a perl background. I was hoping someone could help point me to some sample code to serialize data from a form. My plan is to write a tiny app to generate Cisco switch configuration files based on a template. Below is what I have found so far based

[Rails] Rails 3 requires SQLite?

2011-04-14 Thread Lee
I've installed latest Rails on Centos 5.5, created a test app with "rails new test1", and changed the datatabase config in config/ database.yml to PostgreSQL. "rails server" fails because SQLite is missing. Why is it looking for SQLite when database.yml says PostgreSQL? Thanks for any help. -- Y

Re: [Rails] Re: Rich text editor?

2011-04-14 Thread Paul
Oh, yeah. The two projects that I've extensively used it in are YUI 2 projects. I'd suggest sticking with the YUI 2 version at the moment. I have mixed YUI 2 and YUI 3 very easily in the same project. In fact, most of my projects have pieces of prototype, YUI 2 and YUI 3 co-existing, since I don't

Re: [Rails] Debugger breakpoint ignored in Rails 3 test

2011-04-14 Thread Vladimir Rybas
> Is there anything that I may have missed transitioning from 2.x to 3.x Do you have group :development, :test do gem 'ruby-debug' end in your Gemfile? On Wed, Apr 13, 2011 at 4:53 PM, Fernando Perez wrote: > For some reason my debugger breakpoint is ignored when I run a single > test, but

[Rails] Re: what is the h for in <%=h s.name %>?

2011-04-14 Thread Ad Ber
Ahh...Now I understand better. Thank you Sir. -- 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-talk@googlegroups.com. To unsubscribe from this gro

[Rails] Re: Can someone advise me on Rails memory consumption?

2011-04-14 Thread Gavin Morrice
Still having the same issue running the application on good ole system ruby. Assuming there is a memory leak here, can anybody advise me on how I can find the leak? Otherwise, any other ideas? On Apr 14, 3:26 pm, Bryan Crossland wrote: > On Thu, Apr 14, 2011 at 3:34 AM, Gavin Morrice wrote: > >

Re: [Rails] what is the h for in <%=h s.name %>?

2011-04-14 Thread Philip Hallstrom
> <% songs.each do |s| %> ><%=h s.name %> > <% end %> > > If i will remove the h..the output is still the same.. thank you for > your replies h is an alias for sanitize_html. http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html Try this... <%= "bold?" %> vs <%= h "bo

[Rails] what is the h for in <%=h s.name %>?

2011-04-14 Thread Ad Ber
<% songs.each do |s| %> <%=h s.name %> <% end %> If i will remove the h..the output is still the same.. thank you for your replies -- 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

Re: [Rails] Re: Rich text editor?

2011-04-14 Thread Peter Bell
On Apr 14, 2011, at 12:28 PM, Paul wrote: > Yes, it is marked "beta", but their beta stuff is pretty solid. Only downside seems to be that it says you have to write your own UI . . . Best Wishes, Peter > > On Thu, Apr 14, 2011 at 9:49 AM, Walter Lee Davis wrote: >> >> On Apr 14, 2011, at 9:4

Re: [Rails] Re: Rich text editor?

2011-04-14 Thread Paul
Yes, it is marked "beta", but their beta stuff is pretty solid. On Thu, Apr 14, 2011 at 9:49 AM, Walter Lee Davis wrote: > > On Apr 14, 2011, at 9:43 AM, Paul wrote: > >> I really like the YUI javascript libraries in general, and have used >> their RTE with success: http://developer.yahoo.com/yui

[Rails] Re: Re: hash vs methods

2011-04-14 Thread John Merlino
Phil Crissman wrote in post #992790: > On Thu, Apr 14, 2011 at 10:09 AM, John Merlino > wrote: > >> Thanks for responses. So it's possible to call include? on a method? >> >> dom_class.include?("sortable") >> > > Well, you aren't calling include? on the method, per se... you're > calling > includ

Re: [Rails] Re: hash vs methods

2011-04-14 Thread Phil Crissman
On Thu, Apr 14, 2011 at 10:09 AM, John Merlino wrote: > Thanks for responses. So it's possible to call include? on a method? > > dom_class.include?("sortable") > Well, you aren't calling include? on the method, per se... you're calling include? on _whatever thing the method is returning_. So, i

[Rails] Re: hash vs methods

2011-04-14 Thread John Merlino
Thanks for responses. So it's possible to call include? on a method? dom_class.include?("sortable") -- 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 rubyonr

[Rails] ArgumentError: undefined class/module MyClass

2011-04-14 Thread thaold
Hi all, I'm having troubles while trying to run some of the rack tests. Can someone please advice how to fix the following errors: - ArgumentError: undefined class/module MyClass - ArgumentError (A copy of MyLib::MyClass::ClassMethods has been removed from the module tree but is still active!) I g

[Rails] Re: iCalendar tzid not working?

2011-04-14 Thread Leo Cassarani
I'm having the exact same problem, I was wondering if you'd managed to find a solution since you posted the question. Thanks :) -- 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 gr

Re: [Rails] Can someone advise me on Rails memory consumption?

2011-04-14 Thread Bryan Crossland
On Thu, Apr 14, 2011 at 3:34 AM, Gavin Morrice wrote: > I'm working on a Rails application at the moment which seems to kill > the memory on my iMac until I eventually have to restart. > I have a 2.66 GHZ processor with 4GB Ram on OSX 10.6. > > When I boot the rails app, the memory consumption sho

Re: [Rails] Re: Rich text editor?

2011-04-14 Thread Walter Lee Davis
On Apr 14, 2011, at 9:43 AM, Paul wrote: I really like the YUI javascript libraries in general, and have used their RTE with success: http://developer.yahoo.com/yui/ That looks cool, but do they have a version for YUI3? I could only see one for YUI2. Walter On Thu, Apr 14, 2011 at 8:53

Re: [Rails] Re: Rich text editor?

2011-04-14 Thread Paul
I really like the YUI javascript libraries in general, and have used their RTE with success: http://developer.yahoo.com/yui/ On Thu, Apr 14, 2011 at 8:53 AM, jmanpa wrote: > Try CKeditor.  I am using it right now and so far, so good. -- You received this message because you are subscribed to th

Re: [Rails] TimeZone Select Problemin Rails 3?

2011-04-14 Thread Bryan Crossland
On Wed, Apr 13, 2011 at 2:21 AM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On 13 Apr 2011, at 02:55, "tashfeen.ekram" > wrote: > > > I am running Rails 3.0.3. I am using the below line of code to > > generate a list of possible time zones. > > > > <%= form.time_zone_select :time

Re: [Rails] SEO, MS Word, Compact HTML, and object/data

2011-04-14 Thread Walter Lee Davis
On Apr 14, 2011, at 5:41 AM, Ralph Shnelvar wrote: We have twenty-or-so MS Word 2000 documents that we want to display on our website. What we did was convert the MS Word documents to Compact HTML. We then display a document via an This all works great except for a bit of a fly in the o

Re: [Rails] Re: Rich text editor?

2011-04-14 Thread jmanpa
Try CKeditor. I am using it right now and so far, so good. -- 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-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails

[Rails] strange behavior of ActiveSupport::TimeZone

2011-04-14 Thread Aldo Italo
I was working with the method "in_time_zone" for the class ActiveSupport::TimeZone, when I found an unwanted behavior. I want to set my sights so that display the times for the main zone of Brazil (UTC-3). During the period not DST there is no problem. Instead to view the times for the period DST

[Rails] Re: Rails habtm grief am I dumb or rails bug? (desperate ; )

2011-04-14 Thread Gerald Anderson
Oh, also meant to say I don't know that the habtm thing is a bug (not a feature either : b). It's not the way I would like to see it work but the rails code that I looked at just flat doesn't make allowances for m2m relationship tables outside of the rails db that I could tell. Gerald On Apr 14

[Rails] Re: Rails habtm grief am I dumb or rails bug? (desperate ; )

2011-04-14 Thread Gerald Anderson
Good timing, just got it fixed (non-smelly)and you're pretty close to the mark. The answer? has_many :through - something I'd never taking much of a look at, but it is actually a pretty nice feature (even in other circumstances). Basically this just allows me to create a model class which repres

[Rails] Re: Rails habtm grief am I dumb or rails bug? (desperate ; )

2011-04-14 Thread Matt Jones
On Apr 13, 1:20 pm, Gerald Anderson wrote: > Grr, have had two meetings in the middle of all this, forgive my lack > of coherence.  Bottom line is it looks like it instantiates the engine > as the rails database and with no way (that I know of) of specifying > which db to look at for the relatio

Re: [Rails] Re: Unable to install Rails using Gem

2011-04-14 Thread Michael Pavling
On 14 April 2011 12:30, Shafeeq wrote: > The question is quite simple. But the answer to simple questions is frequently much more complicated... > Is there a way I can package Rails gem and > all its dependencies (in a machine where I have internet connection) > into a single file to be FTPed to

[Rails] Re: Unable to install Rails using Gem

2011-04-14 Thread Shafeeq
I appreciate the time members take to answer my question and help me out. But the answers so far are either not relevant to my question or did not really help me. The question is quite simple. I want to install Rails 3 on a machine(server) where there is no internet connection. I am allowed on

[Rails] Re: Rails 3 Routing: Namespace'd Controllers?

2011-04-14 Thread Kenichi Naito
I feel that the following do work. match ':controller(/:action(/:id))' , :controller=> /admin\/[^\/]+/ In rails3, such a constraint condition for namespaced controllers may be necessary. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the

[Rails] a little problem with extJS & log in form

2011-04-14 Thread HelloRails
have user_cotnroller class UserController < ApplicationController def authenticate if request.post? #User.new(params[:userform]) will create a new object of User, retrieve values from the form and store it variable @user. @user = User.new(params[:use

Re: [Rails] Re: Debugger breakpoint ignored in Rails 3 test

2011-04-14 Thread Colin Law
On 14 April 2011 10:37, Fernando Perez wrote: >> Are you using a ruby command to run the test,  ie ruby >> some_file.rb?  If so then use rdebug rather than ruby. > > Indeed Colin, I just tried with rdebug and now the breakpoints are > honored. But it's a bit painful to use on a single test as the

[Rails] Re: wrong time in application

2011-04-14 Thread Frederick Cheung
On Apr 14, 9:13 am, "Tobias H." wrote: > > How are you displaying them? > > > Fred > > in the view with: > <%= l @execution.created_at %> > > the l means in this case, that i format the date in german notation. > Dumb question: did you restart the server after setting config.time_zone ? Fred >

[Rails] SEO, MS Word, Compact HTML, and object/data

2011-04-14 Thread Ralph Shnelvar
We have twenty-or-so MS Word 2000 documents that we want to display on our website. What we did was convert the MS Word documents to Compact HTML. We then display a document via an This all works great except for a bit of a fly in the ointment. Doing an SEO (Search Engine Optimization) analy

[Rails] Re: Debugger breakpoint ignored in Rails 3 test

2011-04-14 Thread Fernando Perez
> Are you using a ruby command to run the test, ie ruby > some_file.rb? If so then use rdebug rather than ruby. Indeed Colin, I just tried with rdebug and now the breakpoints are honored. But it's a bit painful to use on a single test as the debugger stops once when it hits the require 'test_

[Rails] Can someone advise me on Rails memory consumption?

2011-04-14 Thread Gavin Morrice
I'm working on a Rails application at the moment which seems to kill the memory on my iMac until I eventually have to restart. I have a 2.66 GHZ processor with 4GB Ram on OSX 10.6. When I boot the rails app, the memory consumption shows the following (ps aux | grep rails): Gavin 726 0.0 3

Re: [Rails] wrong time in application

2011-04-14 Thread Régis Mesquita
Try adding this to environment.rb config.active_record.default_timezone = :local 2011/4/14 Tobias H. > hey guys, > > i've got a problem and i really don't know how to solve it. > when i'm creating a new dataset in my application, the created_at and > updated_at time will be saved in UTF Time (+

[Rails] thinking sphinx: query price> 0

2011-04-14 Thread Vasin Alexander
Is a model of products with the indices define_index do indexes: name indexes description has product_shops.price,: as =>: price has catalog_product_connections.catalog_id,: as =>: catalog_id end Need ability to filter by price. The controller write this: Product.searc

[Rails] Re: wrong time in application

2011-04-14 Thread Tobias H.
> How are you displaying them? > > Fred in the view with: <%= l @execution.created_at %> the l means in this case, that i format the date in german notation. greetz, tobias -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups

Re: [Rails] Rails 3.0 Internal Server Error - Not Enough Space

2011-04-14 Thread Colin Law
On 14 April 2011 04:37, Payal Patel wrote: > Hi, > > I have upgraded my project from rails 2.3.4 (ruby 186) to rails 3.0 > (ruby 187). > > For some of the controllers I am getting following error on the > frontend: > > Internal Server Error > Not enough space > WEBrick/1.3.1 (Ruby/1.8.7/2010-12-23

[Rails] Re: wrong time in application

2011-04-14 Thread Frederick Cheung
On Apr 14, 8:05 am, "Tobias H." wrote: > hey guys, > > i've got a problem and i really don't know how to solve it. > when i'm creating a new dataset in my application, the created_at and > updated_at time will be saved in UTF Time (+000). > in my environment.rb i set the following line: >      

Re: [Rails] TimeZone problems upgrading to 3.0.6

2011-04-14 Thread Colin Law
On 12 April 2011 22:40, Stephen H. Gerstacker wrote: > I've been working on the internal app for my company which is well > over 4 years old.  First commit was using Rails 1.1.6. > > I'm now at 2.3.11 and I have a branch of my code that is converted to > 3.0.6, but I just noticed a problem.  The R

[Rails] Rails3 custom data from controller

2011-04-14 Thread miroslav b.
I have some controller (tasks) and wanted to collect requester mail (with formtastic) of this task (some user). Task model has requested_by_id field. Now, I made a view for task edit with all fields, but I don't know how to show requestere's email (association) so I can use autocomplete. I'm breaki

Re: [Rails] Re: script/server (Error)

2011-04-14 Thread Chris Kottom
You need spaces between your YAML keys and values. Example: development: adapter: mysql database: blogg username: root password: 12345 socket: /var/run/mysqld/mysqld.sock On Thu, Apr 14, 2011 at 9:21 AM, amrit pal pathak wrote: > > > On Apr 14, 2:46 am, Chris Kottom wrote: > > Check

[Rails] Re: script/server (Error)

2011-04-14 Thread amrit pal pathak
On Apr 14, 2:46 am, Chris Kottom wrote: > Check your database.yml file.  In many cases, the problem can be due to > indentation, trailing whitespace, etc. The content of database.yml file are as # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development:

[Rails] wrong time in application

2011-04-14 Thread Tobias H.
hey guys, i've got a problem and i really don't know how to solve it. when i'm creating a new dataset in my application, the created_at and updated_at time will be saved in UTF Time (+000). in my environment.rb i set the following line: config.time_zone = 'Berlin' when i'm using the console