Re: [Rails] Re: Re: Re: nill object error

2010-05-20 Thread Colin Law
On 20 May 2010 23:37, Ravi Dtv  wrote:
>
>...
> Can you please solve this error for me
>
> undefined method `each' for 4:Fixnum

I am sure you can work it out for yourself.  Look at the line of code
that generates the error, presumably there is a call to 'each' there.
The error says that you are trying to call each for the value 4 (which
is of type Fixnum), presumably you expected it to be an Array.  If you
can't see the problem by code inspection use ruby-debug to break in
before that line and have a look at the variable you are calling each
on.

Colin

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: get data from has_and_belongs_to_many + has_many

2010-05-20 Thread Michael Pavling
On 20 May 2010 16:59, Sharagoz  wrote:
> On May 20, 4:13 pm, Michael Pavling  wrote:
>> You need to iterate over a's bs [1] collection, and return the related
>> cs.
>
> I don't think that is necessary. It should be possible to get the data
> in a single sql query.
> @cs = C.all(:joins => {:b => :as}, :conditions => {'as.id = 1'})

If you don't have any info apart from a_id (in params, maybe), then
yes, go query the DB in one hit. But if you already have your 'a'
eager-loaded with all its related bs and cs, then there's not much
sense in rebuilding a load of objects; you might as well just select
them out of the collections you have in memory.
Depends on your starting point.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Visual Studio 2010 and NET Framework 4 Training Course

2010-05-20 Thread Ramesh E
*Visual Studio 2010 and NET Framework 4 Training Course

http://rapidlinks007.blogspot.com/2010/05/visual-studio-2010-and-net-framework-4.html


*
*http://rapidlinks007.blogspot.com* 

thanks

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Microsoft Visual Studio 2010 Ultimate With Serial (New Update)

2010-05-20 Thread Ramesh E
*Microsoft Visual Studio 2010 Ultimate With Serial (New Update)*

http://rapidlinks007.blogspot.com/2010/05/microsoft-visual-studio-2010-ultimate.html

http://rapidlinks007.blogspot.com


thanks

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: [Help] Rake test:functionals failed.

2010-05-20 Thread neckie
Dear Colin,
Thanks for you help. I've already fix this problem.

Thank you so much. ^^



On 5月18日, 上午5時01分, clanlaw  wrote:
> On 17 May 2010 10:38, neckie  wrote:
>
> > Hi all,
> > Im a new user for using Rails,
> > I got the 3 error msg as belows,
> >...
> > rake_test_loader
> > Started
> > F.F.F...
> > Finished in -3824716.83084 seconds.
>
> >  1) Failure:
> > test_changes_simple(ApiControllerTest) [/test/functional/
> > api_controller_test.rb:204]:
> > Expected response to be a <:success>, but was <500>
> > <"">
>
> If you look in test.log you may get some clues as to why you are
> getting the 500 error.
> Have you setup database.yml to refer correctly to the test database?
>
> Colin
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Authlogic and Single table inheritance

2010-05-20 Thread Paul A.
Hi,

I have some models such as:

class User < ActiveRecord::Base
  acts_as_authentic
end

class Admin < User
end

class Superadmin < Admin
end

And some controllers such as:

class UserSessionsController < ApplicationController
  def new
@user_session = UserSession.new
  end

  def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
  flash[:notice] = t('user_sessions.flash.create.notice')
  redirect_to root_path
else
  render :action => :new
end
  end

  def destroy
current_user_session.destroy
flash[:notice] = t('user_sessions.flash.destroy.notice')
redirect_to new_session_path
  end
end

class Admin::AdminSessionsController < ApplicationController
  layout 'admin'

  def new
@user_session = UserSession.new
  end

  def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
  flash[:notice] = t('user_sessions.flash.create.notice')
  redirect_to admin_dashboard_path
else
  render :action => :new
end
  end

  def destroy
current_user_session.destroy
flash[:notice] = t('user_sessions.flash.destroy.notice')
redirect_to new_admin_session_path
  end
end

class Superadmin::SuperadminSessionsController <
ApplicationController
  layout 'superadmin'

  def new
@user_session = UserSession.new
  end

  def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
  flash[:notice] = t('user_sessions.flash.create.notice')
  redirect_to superadmin_dashboard_path
else
  render :action => :new
end
  end

  def destroy
current_user_session.destroy
flash[:notice] = t('user_sessions.flash.destroy.notice')
redirect_to new_superadmin_session_path
  end
end

I would like to allow users to login, but only with the good controller
and model.
For instance, if an admin want to log in, its controller should be
Admin::AdminSessionsController (handled Admin model).

But I don't want that, a user connect itself using another interface
like superadmin (and the opposite).

I suppose that I need to add a condition in each controller just before
@user_session.save.  Maybe using @user_session.save... But I don't see
exactly how.

I just know that, it's should be possible to know the type of
current_user thanks to:
current_user.type (as documented at
http://api.rubyonrails.org/classes/ActiveRecord/Base.html)

According to you, how can we do so?

Many 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 group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] can authlogic be used for multiple models?

2010-05-20 Thread swetha


I want to use authlogic plugin for multiple models in my project. In
admin module of the project i am using administrator and
administrator_sessions and also on user module i am using user and
user_sessions models.

So i have a doubt ,whether can we use this authlogic plugin for
multiple models or not?


-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: undefined method `each' for 4:Fixnum

2010-05-20 Thread Ash
Instead of each maybe u should use times

for example
4.times

Ash

On May 21, 4:00 am, Marnen Laibow-Koser  wrote:
> Ravi Dtv wrote:
> > undefined method `each' for 4:Fixnum
>
> > How can I solve this error.
>
> Don't call .each on a number.
>
>
>
> > Thanks
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Re: Re: Agile Web Dev (book) question: errors

2010-05-20 Thread Orient Fang
Colin Law wrote:
> On 18 May 2010 05:04, Orient Fang  wrote:
>>> Are you absolutely certain that is the right cart.rb?  Is that the
>>> complete file?  It looks ok to me.
>>>
>>> Colin
>>
>> Hi Colin,
>> it is, I am sure. I'm wondering is there anywhere else cause the
>> problem.
> 
> There is something odd going on.  I suggest you comment out the
> contents of the file and add bits back in till it fails.   Maybe you
> have an unprintable character that is causing the problem.
> 
> Colin

hi Colin
I solved the problem, it's because I use the utf8 encoding for the new 
*.rb file. the default is the ANSI encoding.
Thanks for you response
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Basic question on RoR, the Web, and Browsers

2010-05-20 Thread Ralph Shnelvar

>> (2) The client issues an asynchronous request (perhaps, an XHR) which 
>> gets fulfilled when the server detects that there has been a change in 
>> some player's data.
> 
> Impossible. That means the server will block till it has new data, which 
> means the client will be stuck, waiting for a response from the server.
> 
> Or do you mean that the client simply polls periodically, and if the 
> server has no new data, it just says so?

Why would the client block?  It's an asynchronous request.

Isn't that the point of an asynchronous request ... not to block?
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Plugin Architecture

2010-05-20 Thread Walter McGinnis
You can do most things with the plugin/gem architecture build into
Rails.  The only thing I have found is that initialization order and
load_path precedence may be different than normal plugins.

With the normal system the applicaiton's views take precedence over
views in an engine plugin or gem.  With an application plugin system
(I call mine "add-ons" to differentiate it from the Rails system), you
may want to reverse this.

Right now I've just built my first "add-on" to the Kete app:

http://github.com/kete/kete_translatable_content/

The rails/init.rb file is where most of the example code you may want
is.  Notice that I add to a set of extensions blocks to run from
within the Kete application after the initialization process has
completed to reopen classes to extend their functionality (other
classes are simply reopened in the config.to_prepare block).  This
ties in on line 108 of the application's environment.rb file:

http://github.com/kete/kete/blob/enhancement_269_refactoring_for_adds_on/config/environment.rb

Hope this helps,
Walter


On Thu, May 20, 2010 at 2:52 AM, Joshua Martin  wrote:
> Does anyone have any suggestions about building a plugin architecture for a
> Rails application?
> This would be different from the Rails plugin architecture; this would be
> plugins for my Rails application in particular (i.e. like Firefox
> extensions, or OpenOffice extensions)
>

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Parse HTML to text

2010-05-20 Thread ahmy
Thank you i found nokogiri is very helpful.

On May 20, 8:10 pm, Marnen Laibow-Koser  wrote:
> Amala Singh wrote:
> > There are many ways.
>
> > One way is Hpricot gem.
>
> That's true, but I think most people are using Nokogiri these days.
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] REXML, rake aborted! Text is not a module

2010-05-20 Thread Chris Sass
I am writing a rake task for my rails app to parse data from an XML and
keep getting the error:
rake aborted!
Text is not a module

here are the contents of my lib/tasks/xml_parse.rake
#
require 'rexml/document'
include REXML

namespace :xml do

  task :parse => :environment do
puts "hello"
#commented out everything else until it works
#...
end
end
#--


The output looks like this...

#--

imac:HAA-TMS chris$ rake xml:parse --trace
(in /Users/chris/Projects/HAA-TMS)
hello1
** Invoke xml:parse (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Text is not a module
/opt/local/lib/ruby/gems/1.8/gems/actionmailer-2.3.5/lib/action_mailer.rb:52
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
`require'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
`new_constants_in'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
`require'
/Users/chris/.gem/ruby/1.8/gems/rails-2.3.5/lib/initializer.rb:268:in
`require_frameworks'
/Users/chris/.gem/ruby/1.8/gems/rails-2.3.5/lib/initializer.rb:268:in
`each'
/Users/chris/.gem/ruby/1.8/gems/rails-2.3.5/lib/initializer.rb:268:in
`require_frameworks'
/Users/chris/.gem/ruby/1.8/gems/rails-2.3.5/lib/initializer.rb:134:in
`process'
/Users/chris/.gem/ruby/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in
`send'
/Users/chris/.gem/ruby/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in
`run'
/Users/chris/Projects/HAA-TMS/config/environment.rb:5
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
`require'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
`new_constants_in'
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
`require'
/Users/chris/.gem/ruby/1.8/gems/rails-2.3.5/lib/tasks/misc.rake:4
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in
`execute'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in
`execute'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in
`invoke_with_call_chain'
/opt/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in
`invoke_prerequisites'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in
`invoke_prerequisites'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in
`invoke_with_call_chain'
/opt/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
`invoke_with_call_chain'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in
`invoke_task'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`top_level'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in
`top_level'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in
`top_level'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in
`standard_exception_handling'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/opt/local/bin/rake:19:in `load'
/opt/local/bin/rake:19
#--



The only line trace is spitting out from my code is
/Users/chris/Projects/HAA-TMS/config/environment.rb:5
...and that line is the...
Rails::Initializer.run do |config|


The rake task will run fine if I remove the reference "=> :environment"
from the task declaration but I need that so I can write the XML data to
a model in my application.

Also I'm using ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin10] on
snow leopard with rubygems 1.3.5 just in case that helps

If you've read this far, I really appreciate it.

Many thanks in advance,

Chris
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message

[Rails] No default .htaccess

2010-05-20 Thread Simon Che
Hey all!

I just created my first RoR project (following this guide
http://wiki.rubyonrails.org/start), and I had some trouble getting
everything to work under apache with passenger. After some debugging I
found out I simply didn't had any .htaccess in my public/ folder. People
around the interwebz seemed to imply there should be one by default, so
my questions are :

 - Why wasn't there one created with my application?
 - Also, I didn't have any problem when I ran my application using
webrick. How come?

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 group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Looking for Easy Rails hosting

2010-05-20 Thread Marnen Laibow-Koser
Victor Stan wrote:
[...]
> Heroku is supposed to be simple, but I found
> it more complicated than not. 

In what way?  Git push, migrate, done.  How much simpler do you want?

> Also cloud hosting is more expensive
> than 'classic' hosting unless you plan on being the next Facebook...
>

Nope.  Look at Rackspace Cloud's pricing and say that again with a 
straight face.

> - V

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Basic question on RoR, the Web, and Browsers

2010-05-20 Thread Marnen Laibow-Koser
Ralph Shnelvar wrote:
> Marnen Laibow-Koser wrote:
>> 
>> Probably.  Push is hard to impossible with Web technologies, unless you 
>> use Java or maybe Flash.  But you can certainly poll for updates with 
>> Ajax, which is no different on the server side than just hitting 
>> "reload" repeatedly in the browser.
> 
> I had this idea ... tell me what's wrong with it.
> 
> 
> 
> On the client side:
> 
> (1) Whenever the user changes her data we issue an Ajax request to 
> update the data the server knows about.

Fine.

> 
> (2) The client issues an asynchronous request (perhaps, an XHR) which 
> gets fulfilled when the server detects that there has been a change in 
> some player's data.

Impossible. That means the server will block till it has new data, which 
means the client will be stuck, waiting for a response from the server.

Or do you mean that the client simply polls periodically, and if the 
server has no new data, it just says so?

> 
> On the server side:
> 
> (3) The server waits for an Ajax request indicates that the client has 
> changed some data.

Sure.

> 
> (4) The server then satisfies the request(s) made in (2).
> 
> 

...blocking the client until it does so.

> 
> I have no idea how to have the server sit on an unfulfilled Ajax (or any 
> other) request.

Good.  You don't want to.

What you may be looking for is Comet (essentially Ajax over a persistent 
HTTP connection), but that's really hard to do AFAIK.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Looking for Easy Rails hosting

2010-05-20 Thread Victor S
I am hosting on Site5 and it was quite a simple process, some forum
tutorial reading might be required if you aren't very familiar with
passenger. I'm using git to synch between my production and local dev
code and its a breeze... Heroku is supposed to be simple, but I found
it more complicated than not. Also cloud hosting is more expensive
than 'classic' hosting unless you plan on being the next Facebook...

- V

On May 20, 3:15 pm, Deon Silva  wrote:
> I would recommend webappcabaret.com.
> They have RAILS already setup to run on Mongrel, Passenger as well as
> Glassfish.
> Price start at $10 per month. And you are still able to use cPanel or
> Plesk
> for general website management.
>
> Mohammed Alenazi wrote:
> > Hi
>
> > I have registered for some paid rails hosting  system that uses cpanel
> > to deploy the rails apps. I could not deploy my app/ I tried several
> > times with no success.
>
> > Does any one know a good hosting company that provide guidelines or
> > tutorial on how to deploy that rails apps on their servers?
>
> --
> Posted viahttp://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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: ActionController::UrlWriter bug -- need help URGENTLY, thanks!

2010-05-20 Thread Carter Gilchrist
ad...@fotocera.com wrote:
> I am generating a URL for use with GoogleCheckout. I have a method in
> a model that uses the visitors shopping cart to construct an xml
> request to GoogleCheckout, in that request i need to include a
> callback url that GoogleCheckout can use to contact my webapp.

I am in the same situation, needing to access the named routes from 
within a class method and am having no luck coming up with a logic 
solution. It seems that every post out there asking the same thing gets 
met with "if it's so difficult, you probably shouldn't be doing it." I 
usually agree with this, but generating a callback for any 3rd party api 
calls that get made at a class level seems like a pretty acceptable 
requirement.

Did you ever come to a solution that worked for you ad...@fotocera?
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Postgres + Rail 3.0

2010-05-20 Thread Ho-Sheng Hsiao

Uh, I know now about the postgresql-pr gem. Part of the confusion is
that there are several PostgreSQL gems laying around. The one I used
is "pg".

You will also need to drop it into Gemfiles.

Ho-Sheng Hsiao
http://ruby-lambda.blogspot.com

On May 20, 11:48 am, Ravi Dtv  wrote:
> Siva Kilaru wrote:
> > Hi guys,
>
> > I am really new to these things like ROR and Postgres.
>
> > When I was installing ROR 3.0 it says
>
> > Successfully installed rails 3.0.0 beta
> > 1 gem installed
> > Installing ri document for rails 3.0.0 beta
> > File not Found: lib
>
> > This is the one which I really dont understand and dont know what to do?
> > Help me out guys plz...
>
> > And I want to configure the database with postgresql and I want to know
> > how it works...
>
> For PostgreSQL try this
> to install the following gem to use postgresql: install gem postgres-pr
>
> Go through the link and scroll down for Installing 
> PosgreSQLhttp://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-ra...
>
> Hope this helps you.
> --
> Posted viahttp://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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Basic question on RoR, the Web, and Browsers

2010-05-20 Thread Ralph Shnelvar
Marnen Laibow-Koser wrote:
> 
> Probably.  Push is hard to impossible with Web technologies, unless you 
> use Java or maybe Flash.  But you can certainly poll for updates with 
> Ajax, which is no different on the server side than just hitting 
> "reload" repeatedly in the browser.

I had this idea ... tell me what's wrong with it.



On the client side:

(1) Whenever the user changes her data we issue an Ajax request to 
update the data the server knows about.

(2) The client issues an asynchronous request (perhaps, an XHR) which 
gets fulfilled when the server detects that there has been a change in 
some player's data.

On the server side:

(3) The server waits for an Ajax request indicates that the client has 
changed some data.

(4) The server then satisfies the request(s) made in (2).



I have no idea how to have the server sit on an unfulfilled Ajax (or any 
other) request.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Validates_presence_of fails on observer

2010-05-20 Thread Jonhy Pear
Hi,

I have the following model that uses the plugin act_as_voteable:

class Video < ActiveRecord::Base
  belongs_to :user
  acts_as_voteable
  acts_as_commentable
  attr_accessible :url, :title, :description, :vote_count
  validates_presence_of :url, :title, :description

...
end


I also have an observer for Vote model, so each time a user cast a vote to a
video, or other content, I will update some info, including the vote_count
on video model or other content. The code that runs each time a vote is
created is:

def update_user_points_and_votes_count(vote, factor)
 content_clazz = Kernel.const_get(vote.voteable_type)

  content.vote_count +=1*factor
  content.save!
  ...
  ...
end

Basically, I will update vote_count when a vote is casted to a video, or
other kind of content that act_as_voteable.

The problem is that the instruction content.save! raises a validation
exception on :url (in the list of validates_presence_of). I think that it
will fail also on the other attributes in the list of validates_presence_of.

What I'm missing?

thank you,
Jp

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: using searchlogic to retrieve ids, then rebuild object?

2010-05-20 Thread dan
fixed

changed my :grouped named_scope to distinct:

named_scope :distinct, :select => "distinct locations.*"

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Strange error in unit test => TypeError: wrong argument type Class (expected Module)

2010-05-20 Thread vfr292
Hi,

Well, I have have continued to work on this, but with no luck.

The error pops up for every test I run for every model and controller
(not just the test1 model).

Any ideas?

~Victor

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: undefined method `each' for 4:Fixnum

2010-05-20 Thread Marnen Laibow-Koser
Ravi Dtv wrote:
> undefined method `each' for 4:Fixnum
> 
> 
> How can I solve this error.

Don't call .each on a number.

> 
> Thanks

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] undefined method `each' for 4:Fixnum

2010-05-20 Thread Ravi Dtv
undefined method `each' for 4:Fixnum


How can I solve this error.

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 group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Printed/PDF Reports (Text/Tabular/Summary) in Rails

2010-05-20 Thread Marnen Laibow-Koser
Jeremy Cowgar wrote:
[...]
> Any suggestions? I have used FOP in the past and there is no way it's
> powerful enough for some of the things we do. In some synarios, we
> really had to push the limits of ReportLab (and sometimes confined by
> them).

I doubt extremely that FOP isn't powerful enough.  FO can handle just 
about any layout you'd care to throw at it.  But its syntax is pretty 
awful.

I'd suggest looking at one of the many Ruby PDF libraries or a tool like 
wkhtmltopdf.

> 
> Thanks!
> 
> Jeremy

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Basic question on RoR, the Web, and Browsers

2010-05-20 Thread Marnen Laibow-Koser
Ralph Shnelvar wrote:
> Marnen Laibow-Koser wrote:
>> Frederick Cheung wrote:
>>> On May 20, 6:23�pm, Ralph Shnelvar  wrote:
 First of all, thank you about the info about the tcp connection. �Can
 you point me at any additional information about that, please?

>>> 
>>> Not that I can think of - it's just how  people write network software
>> 
>> Yeah.  If you need to think about the TCP connection when writing a 
>> simple Web application, you've already made a design error.
> 
> With luck, the game will be played by a lot of people.
> 
> What I want is for all the players to be seeing the same ... relatively 
> simple, screen.
> 
> And if any one of them makes a change then all of the players will see 
> the change.
> 
> In effect, I want to push data out when there is a change.
> 
> Am I thinking at the wrong level of abstraction?

Probably.  Push is hard to impossible with Web technologies, unless you 
use Java or maybe Flash.  But you can certainly poll for updates with 
Ajax, which is no different on the server side than just hitting 
"reload" repeatedly in the browser.


Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Re: Re: nill object error

2010-05-20 Thread Ravi Dtv

>>>
>>> I can see my groupname displaying in my page, but when I click on my
>>> groupname link, Im not able to pass �groupname to my controller.
>> 
>> Using a hidden field does not work as you are not in a form.  That is
>> how to do it if you were submitting from a form.  Instead just include
>> the name in the url - something like
>>  <%= link_to_remote g.group_name, :update => "abc", :url => {
>> :controller => "users" , :action => "showfriendslist", :group_name =>
>> g.group_name } %>
>> 
>> Look at the html generated by this to check that it is being included 
>> correctly.
>> 
>> Colin
> 
> Thank you Colin
> 
> I got the  output.

Can you please solve this error for me

undefined method `each' for 4:Fixnum


-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Re: Re: nill object error

2010-05-20 Thread Ravi Dtv
Colin Law wrote:
> On 20 May 2010 17:19, Ravi Dtv  wrote:
>> �"users" , :action => "showfriendslist" } %>
>>
>> � <%= hidden_field_tag :group_name �%>
>> 
>> 
>> <% end %>
>>
>> I can see my groupname displaying in my page, but when I click on my
>> groupname link, Im not able to pass �groupname to my controller.
> 
> Using a hidden field does not work as you are not in a form.  That is
> how to do it if you were submitting from a form.  Instead just include
> the name in the url - something like
>  <%= link_to_remote g.group_name, :update => "abc", :url => {
> :controller => "users" , :action => "showfriendslist", :group_name =>
> g.group_name } %>
> 
> Look at the html generated by this to check that it is being included 
> correctly.
> 
> Colin

Thank you Colin

I got the  output.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Rails, Thrift, and Phusion Passenger.

2010-05-20 Thread Adam Ms.
I'm about to start a project that uses Rails, Thrift, and Phusion
Passenger.

The Rails instances will be Thrift clients.

If anyone has any pointers to tips or tricks for maximizing Thrift
performance I'd be grateful.

In particular it looks like I will need to create a Thrift client pool
that initializes at boot time.

TIA!
Adam.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] List of radio buttons

2010-05-20 Thread Hassan Schroeder
On Thu, May 20, 2010 at 2:46 PM, Smok  wrote:
> I need to create in RoR 2.3.5 a list of questions ( the number of
> questions will be changing). The answers will be near to each of the
> these questions in radiobuttons (let's say 3 radios near each of
> thequestions). After having compleated all of these questions I would
> like to read all the answers and using ONE update insert them to the
> database(mySQL). Is it possible to create this functionality without
> js?

Of course. You're describing a basic form. Why would you think you
need JavaScript to submit it and process the data?

Or am I misunderstanding your goal?

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Check URL

2010-05-20 Thread David Zhu


On May 20, 6:12 pm, Philip Hallstrom  wrote:
> On May 20, 2010, at 3:05 PM, David Zhu wrote:
>
> > Is there a way to do an if/else case to check the URL? for example-
>
> > <% if URL = "http://www.google.com"; %>
>
> > Hi, your URL's GOOGLE
>
> > <% else %>
>
> > You URL isn't GOOGLE
>
> > <% end %>
>
> > Of course that method is just a mockup, does anyone know the real
> > syntax? Thanks
>
> <% if request.url == 'http://www.google.com'%>
>   GOOGLE!
> <% else %>
>   not google
> <% end %>
>
> That's literally what you're asking, but not sure if it's really what you 
> want to do.  You might be better off checking params[:controller] and 
> params[:action] perhaps.  Or doing a regular expression match to pick up 
> "http://google.com"; and "http://maps.google.com/q=12345+Maple+St";, etc.
>
> But... in any event, request.url will give you what the browser sees in their 
> location bar.
>
> -philip

YUP! sweet dude, thanks :D



>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Check URL

2010-05-20 Thread Philip Hallstrom

On May 20, 2010, at 3:05 PM, David Zhu wrote:

> Is there a way to do an if/else case to check the URL? for example-
> 
> <% if URL = "http://www.google.com"; %>
> 
> Hi, your URL's GOOGLE
> 
> <% else %>
> 
> You URL isn't GOOGLE
> 
> <% end %>
> 
> Of course that method is just a mockup, does anyone know the real
> syntax? Thanks

<% if request.url == 'http://www.google.com' %>
  GOOGLE!
<% else %>
  not google
<% end %>

That's literally what you're asking, but not sure if it's really what you want 
to do.  You might be better off checking params[:controller] and 
params[:action] perhaps.  Or doing a regular expression match to pick up 
"http://google.com"; and "http://maps.google.com/q=12345+Maple+St";, etc.

But... in any event, request.url will give you what the browser sees in their 
location bar.

-philip

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Re: Rendering a partial on a two column page

2010-05-20 Thread Rob Biedenharn


On May 20, 2010, at 5:45 PM, Matt Royer wrote:


Rob Biedenharn wrote:

Hi Rob,

Thanks for the quick response!

I'm sorry, I'm still relatively new at this Rails stuff. I have gone
through a couple of books, but it's hard to tie it all together. :)

When you put the following:


  :id => order.id


Where should I enter that? Within the link_to_remote somewhere?


Yes, right where I put it:


<%= link_to_remote "Show", :url => {:controller =>
'orders', :action => 'show',


 :id => order.id


}, :update => "order_div", :method => 'get'
%>




Also, I would like to know the following. Not sure where I would enter
that path in the link_to_remote:


But you could also use a named route for the url.  Something like
order_path(order)


Thanks again! I need all the help I can get. :)


<%= link_to_remote("Show", :url => order_path(order),
   :update => "order_div",
   :method => 'get') %>

-Rob

Rob Biedenharn
http://agileconsultingllc.com
r...@agileconsultingllc.com
http://gaslightsoftware.com
r...@gaslightsoftware.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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Check URL

2010-05-20 Thread David Zhu
Is there a way to do an if/else case to check the URL? for example-

<% if URL = "http://www.google.com"; %>

Hi, your URL's GOOGLE

<% else %>

You URL isn't GOOGLE

<% end %>

Of course that method is just a mockup, does anyone know the real
syntax? Thanks

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Basic question on RoR, the Web, and Browsers

2010-05-20 Thread Ralph Shnelvar
Marnen Laibow-Koser wrote:
> Frederick Cheung wrote:
>> On May 20, 6:23�pm, Ralph Shnelvar  wrote:
>>> First of all, thank you about the info about the tcp connection. �Can
>>> you point me at any additional information about that, please?
>>>
>> 
>> Not that I can think of - it's just how  people write network software
> 
> Yeah.  If you need to think about the TCP connection when writing a 
> simple Web application, you've already made a design error.

With luck, the game will be played by a lot of people.

What I want is for all the players to be seeing the same ... relatively 
simple, screen.

And if any one of them makes a change then all of the players will see 
the change.

In effect, I want to push data out when there is a change.

Am I thinking at the wrong level of abstraction?
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Activerecord association design advice

2010-05-20 Thread Ali Akhtarzada
Heh, not the matrix. What I am programming though is a ratable ontology, so
the initial email with Concept, Entity and Dimension is the real code and
I'm afraid flexibility is one of my main concerns because the number of
vehicles, models and dimensions are completely unknown. So, single table
inheritance on the vehicles is out of the question for the final
application, unless of course there is a way to define models at run time,
maybe every time a user defines a new vehicle I can call the ruby generator
or something and have it create a class and corresponding tables. That may
be overkill though. Is there any examples of web applications programming
themselves? Now that sounds like some fun.

Anyway, the end goal is the ratable ontology (thesis related). For the
prototype I'm developing though, I could use inheritance. The prototype uses
2 parent concepts and a few child ones (Drink and Food would be the parent
concepts, and the child concepts are: Cocktail, Beer, Wine, NonAlcoholic for
the former and Starter, Main and Dessert for the latter). So single table
inheritance sounds good here.

Subjective dimensions are a result of a user deciding what gives an object
value. So a user would go into the system and decide that, "ooh, I think the
rate at which a window can be lowered and raised makes a difference for me
when rating a car", so then the user will define a new subjective dimension:
window_raise_speed. The application will then attach that new subjective
dimension to all the cars and allow all users of the system from that point
on to rate a car over window_raise_speed.

The thing about subjective dimensions is that they are all ordinal values,
so they are all represented by floats. The actual values don't mean
anything, but what they represent do (max_value means window_raise_speed is
'perfect', or 'couldn't ask for more', hence the subjectivity). I see your
point when it comes to factual dimensions though, because they are not all
ordinal and could be of any type.

Really appreciate the feedback.
Thanks!

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] List of radio buttons

2010-05-20 Thread Smok
I need to create in RoR 2.3.5 a list of questions ( the number of
questions will be changing). The answers will be near to each of the
these questions in radiobuttons (let's say 3 radios near each of
thequestions). After having compleated all of these questions I would
like to read all the answers and using ONE update insert them to the
database(mySQL). Is it possible to create this functionality without
js?

Kind regards,
Smok

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Re: Rendering a partial on a two column page

2010-05-20 Thread Matt Royer
Rob Biedenharn wrote:

Hi Rob,

Thanks for the quick response!

I'm sorry, I'm still relatively new at this Rails stuff. I have gone 
through a couple of books, but it's hard to tie it all together. :)

When you put the following:

>:id => order.id

Where should I enter that? Within the link_to_remote somewhere?

Also, I would like to know the following. Not sure where I would enter 
that path in the link_to_remote:

> But you could also use a named route for the url.  Something like
> order_path(order)

Thanks again! I need all the help I can get. :)

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: using searchlogic to retrieve ids, then rebuild object?

2010-05-20 Thread dan
#model location.rb
named_scope :grouped, :select => 'locations.id', :group =>
'locations.id'
has_many :criterias, :through => :locations_criterias

#controller locations_controller.rb
# i havent even gotten to the paginate part yet
@locations = Location.criterias_name_or_name_like(@query).grouped
#.paginate(:page => params[:page])

the @locations returns multiples of same result
so i added the grouped named scope that only selects the id in order
to only group on id
at this point i need to rebuild my location object using the id
returned by @locations

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Install eventmachine on Debian Lenny

2010-05-20 Thread Jeffrey L. Taylor
Odd,
  What about 

ls /usr/include/sys

or if you have the find-utils

locate cdefs.h

Jeffrey

Quoting Juan Jos?é Vidal Agust?ín :
> Yes
> 
> # dpkg -l | grep libc6
> 
> ii  libc6   2.7-18lenny2
> GNU C Library: Shared libraries
> ii  libc6-dev   2.7-18lenny2
> GNU C Library: Development Libraries and Hea
> ii  libc6-i386  2.7-18lenny2
> GNU C Library: 32bit shared libraries for AM
> 
> 
> El 20/05/10 21:57, Jeffrey L. Taylor escribió:
> >Do you have libc6-dev installed?
> >
> >Jeffrey
> >
> >Quoting Juan José Vidal:
> >>Hi,
> >>
> >>I can't install eventmachine on Debian Lenny. ruby-dev and
> >>build-essential are installed. Where's the problem?
> >[snip]
> >>-DHAVE_RB_TIME_NEW -DOS_UNIX -DWITHOUT_SSL -I/include/include-fPIC
> >>-fno-strict-aliasing -g -g -O2  -fPIC-c files.cpp
> >>In file included from /usr/include/c
> >>++/4.3/x86_64-linux-gnu/bits/os_defines.h:44,
> >>  from /usr/include/c++/4.3/x86_64-linux-gnu/bits/c
> >>++config.h:40,
> >>  from /usr/include/c++/4.3/iostream:44,
> >>  from project.h:29,
> >>  from files.cpp:20:
> >>/usr/include/features.h:330:25: error: sys/cdefs.h: No existe el fichero
> >>o el directorio
> >[snip]
> >
> 
> -- 
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
> 

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] attachment_fu slows down update

2010-05-20 Thread Sam Kong
Hi,

I use attachment_fu and it slows down update.

[Models]
product has many pictures.

[Update]
product.update_attributes("pictures_attributes"=>{
"6"=>{"_delete"=>"0", "color_id"=>"3", "id"=>"2953"},
"11"=>{"_delete"=>"0", "color_id"=>"9", "id"=>"2921"},
"22"=>{"_delete"=>"0", "color_id"=>"24", "id"=>"2977"},
"7"=>{"_delete"=>"0", "color_id"=>"4", "id"=>"2965"},
"12"=>{"_delete"=>"0", "color_id"=>"10", "id"=>"2949"},
"23"=>{"_delete"=>"0", "color_id"=>"27", "id"=>"2969"},
"8"=>{"_delete"=>"0", "color_id"=>"5", "id"=>"2917"},
"13"=>{"_delete"=>"0", "color_id"=>"11", "id"=>"2913"},
"24"=>{"_delete"=>"0", "color_id"=>"28", "id"=>"2985"},
"9"=>{"_delete"=>"0", "color_id"=>"7", "id"=>"2989"},
"14"=>{"_deete"=>"0", "color_id"=>"12", "id"=>"2973"},
"25"=>{"_delete"=>"0", "color_id"=>"77", "id"=>"2997"},
"15"=>{"_delete"=>"0", "color_id"=>"13", "id"=>"2925"},
"0"=>{"_delete"=>"0", "color_id"=>"", "id"=>"2937"},
"16"=>{"_delete"=>"0", "color_id"=>"14", "id"=>"2941"},
"1"=>{"_delete"=>"0", "color_id"=>"", "id"=>"2981"},
"17"=>{"_delete"=>"0", "color_id"=>"14", "id"=>"1897"},
"2"=>{"_delete"=>"0", "color_id"=>"", "id"=>"2961"},
"18"=>{"_delete"=>"0", "color_id"=>"16", "id"=>"2929"},
"3"=>{"_delete"=>"0", "colo_id"=>"2", "id"=>"2909"},
"19"=>{"_delete"=>"0", "color_id"=>"17", "id"=>"2945"},
"20"=>{"_delete"=>"0", "color_id"=>"18", "id"=>"2957"},
"4"=>{"_delete"=>"0", "color_id"=>"2", "id"=>"1893"},
"10"=>{"_delete"=>"0", "color_id"=>"8", "id"=>"2993"},
"21"=>{"_delete"=>"0", "color_id"=>"21", "id"=>"2933"},
"5"=>{"_delete"=>"0", "color_id"=>"3", "id"=>"1901"}
})

This takes 15 seconds.

The workaround I found is
product.attributes = "pictures_attributes"=>{
"6"=>{"_delete"=>"0", "color_id"=>"3", "id"=>"2953"},
"11"=>{"_delete"=>"0", "color_id"=>"9", "id"=>"2921"},
"22"=>{"_delete"=>"0", "color_id"=>"24", "id"=>"2977"},
"7"=>{"_delete"=>"0", "color_id"=>"4", "id"=>"2965"},
"12"=>{"_delete"=>"0", "color_id"=>"10", "id"=>"2949"},
"23"=>{"_delete"=>"0", "color_id"=>"27", "id"=>"2969"},
"8"=>{"_delete"=>"0", "color_id"=>"5", "id"=>"2917"},
"13"=>{"_delete"=>"0", "color_id"=>"11", "id"=>"2913"},
"24"=>{"_delete"=>"0", "color_id"=>"28", "id"=>"2985"},
"9"=>{"_delete"=>"0", "color_id"=>"7", "id"=>"2989"},
"14"=>{"_deete"=>"0", "color_id"=>"12", "id"=>"2973"},
"25"=>{"_delete"=>"0", "color_id"=>"77", "id"=>"2997"},
"15"=>{"_delete"=>"0", "color_id"=>"13", "id"=>"2925"},
"0"=>{"_delete"=>"0", "color_id"=>"", "id"=>"2937"},
"16"=>{"_delete"=>"0", "color_id"=>"14", "id"=>"2941"},
"1"=>{"_delete"=>"0", "color_id"=>"", "id"=>"2981"},
"17"=>{"_delete"=>"0", "color_id"=>"14", "id"=>"1897"},
"2"=>{"_delete"=>"0", "color_id"=>"", "id"=>"2961"},
"18"=>{"_delete"=>"0", "color_id"=>"16", "id"=>"2929"},
"3"=>{"_delete"=>"0", "colo_id"=>"2", "id"=>"2909"},
"19"=>{"_delete"=>"0", "color_id"=>"17", "id"=>"2945"},
"20"=>{"_delete"=>"0", "color_id"=>"18", "id"=>"2957"},
"4"=>{"_delete"=>"0", "color_id"=>"2", "id"=>"1893"},
"10"=>{"_delete"=>"0", "color_id"=>"8", "id"=>"2993"},
"21"=>{"_delete"=>"0", "color_id"=>"21", "id"=>"2933"},
"5"=>{"_delete"=>"0", "color_id"=>"3", "id"=>"1901"}
})
product.save false

This is fast but I am not sure this is the right way.
Is there a better way?

Thanks.

Sam
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Rendering a partial on a two column page

2010-05-20 Thread Rob Biedenharn


On May 20, 2010, at 5:01 PM, Matt Royer wrote:


Okay, I made a really dumb mistake and put:

<% javascript_include_tag 'defaults' %>

Instead of:

<% javascript_include_tag :defaults %>

So that fixed my rendering. At least I'm getting information over to  
the

other column now. But it's an error, because it can't find the ID. I
attached the screenshot of the error I'm seeing. The following will be
the code I currently have pertaining to this function. If anyone has  
any

ideas on why it's throwing that error, I would really appreciate it (I
know I'm missing something small here).

Here is my Show action in the Controller:

 def show
   @order = Order.find(params[:id])

   respond_to do |format|
 format.html # show.html.erb
 format.xml  { render :xml => @order }

   end
 end



Here's the sections I have in my index.html.erb file:

 <% @orders.each do |order| %>
   
 <%=h order.id %>
 <%=h order.name %>
 <%= link_to_remote "Show", :url => {:controller =>
'orders', :action => 'show',


  :id => order.id


}, :update => "order_div", :method => 'get'
%>
   
 <% end %>

--

 

 



Here is the info in the _order_show.html.erb partial:


 Name:
 <%=h @order.name %>



 Address:
 <%=h @order.address %>



 City:
 <%=h @order.city %>



 State:
 <%=h @order.state %>



 Zip:
 <%=h @order.zip %>


.ETC

Attachments:
http://www.ruby-forum.com/attachment/4747/ScreenShot004.jpg




But you could also use a named route for the url.  Something like  
order_path(order)


-Rob

Rob Biedenharn
http://agileconsultingllc.com
r...@agileconsultingllc.com
http://gaslightsoftware.com
r...@gaslightsoftware.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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Problem with installation of Rails 3

2010-05-20 Thread Siva Kilaru
Jeff Cohen wrote:
 database.yml:
> 
> development:
>adapter: postgresql
>host: localhost   # or your server name
>database: my_app_development
>username: me
>password: password
> 
> and similarly change the test and production sections too.
> 
> Once you've done that, you can use rake db:create to automatically
> create your local postgres database which I think is pretty cool.
> 
> In the future, when you create a new Rails app, you can use the -d
> option to specify postgresql, which will generate the database.yml for
> you from the beginnning.
> 
> Jeff
> 
> purpleworkshops.com

Once again thank you jeff

I was able to change the database.yml file...but I dint understand what 
to change on test and production sections(I was a new guy for ROR)

I was able to create a new db too.

Thanks jeff again, this info helped me alot

Could u please tell me what to update on those two files

Best Wishes
Siva

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Basic question on RoR, the Web, and Browsers

2010-05-20 Thread Marnen Laibow-Koser
Frederick Cheung wrote:
> On May 20, 6:23�pm, Ralph Shnelvar  wrote:
>> First of all, thank you about the info about the tcp connection. �Can
>> you point me at any additional information about that, please?
>>
> 
> Not that I can think of - it's just how  people write network software

Yeah.  If you need to think about the TCP connection when writing a 
simple Web application, you've already made a design error.

> 
>> > One way of doing things might be for there to be a games table, and
>> > pass the id of the game either in the url or stash it in the session
>> > (session not so hot if this is actually going to be two tabs in the
>> > same browser)
>>
>> When on stores it in the session, where is that stored???

Configurable within Rails.  Generally cookie or database table.

>>
>> I am still very lost as to what a session is. �Is there a good article
>> you could recommend?
>>
> 
> http://guides.rubyonrails.org/security.html#sessions
> 

Rails generally does a good enough job of session management that you 
can treat it as magic.  Your automated tests will take care of the rest.

> Fred

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Rendering a partial on a two column page

2010-05-20 Thread Matt Royer
Okay, I made a really dumb mistake and put:

<% javascript_include_tag 'defaults' %>

Instead of:

<% javascript_include_tag :defaults %>

So that fixed my rendering. At least I'm getting information over to the 
other column now. But it's an error, because it can't find the ID. I 
attached the screenshot of the error I'm seeing. The following will be 
the code I currently have pertaining to this function. If anyone has any 
ideas on why it's throwing that error, I would really appreciate it (I 
know I'm missing something small here).

Here is my Show action in the Controller:

  def show
@order = Order.find(params[:id])

respond_to do |format|
  format.html # show.html.erb
  format.xml  { render :xml => @order }

end
  end



Here's the sections I have in my index.html.erb file:

  <% @orders.each do |order| %>

  <%=h order.id %>
  <%=h order.name %>
  <%= link_to_remote "Show", :url => {:controller => 
'orders', :action => 'show'}, :update => "order_div", :method => 'get' 
%>

  <% end %>

--

  

  



Here is the info in the _order_show.html.erb partial:


  Name:
  <%=h @order.name %>



  Address:
  <%=h @order.address %>



  City:
  <%=h @order.city %>



  State:
  <%=h @order.state %>



  Zip:
  <%=h @order.zip %>


.ETC

Attachments:
http://www.ruby-forum.com/attachment/4747/ScreenShot004.jpg

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Rails 3 Routing problem

2010-05-20 Thread Adam Leonard
Conrad Taylor wrote:
> On Thu, May 20, 2010 at 12:57 PM, Adam Leonard  
> wrote:
> 
>>
> Please post the routes file or the relevant sections of it to better 
> assist
> you?
> 
> -Conrad

http://privatepaste.com/64e55f8503 is my full routes file.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Install eventmachine on Debian Lenny

2010-05-20 Thread Juan JosŽé Vidal Agust’ín

Yes

# dpkg -l | grep libc6

ii  libc6   2.7-18lenny2   
GNU C Library: Shared libraries
ii  libc6-dev   2.7-18lenny2   
GNU C Library: Development Libraries and Hea
ii  libc6-i386  2.7-18lenny2   
GNU C Library: 32bit shared libraries for AM



El 20/05/10 21:57, Jeffrey L. Taylor escribió:

Do you have libc6-dev installed?

Jeffrey

Quoting Juan José Vidal:
   

Hi,

I can't install eventmachine on Debian Lenny. ruby-dev and
build-essential are installed. Where's the problem?
 

[snip]
   

-DHAVE_RB_TIME_NEW -DOS_UNIX -DWITHOUT_SSL -I/include/include-fPIC
-fno-strict-aliasing -g -g -O2  -fPIC-c files.cpp
In file included from /usr/include/c
++/4.3/x86_64-linux-gnu/bits/os_defines.h:44,
  from /usr/include/c++/4.3/x86_64-linux-gnu/bits/c
++config.h:40,
  from /usr/include/c++/4.3/iostream:44,
  from project.h:29,
  from files.cpp:20:
/usr/include/features.h:330:25: error: sys/cdefs.h: No existe el fichero
o el directorio
 

[snip]

   


--
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] url_for escape=>false, builder xml template?

2010-05-20 Thread Jonathan Rochkind
The Rails documentation says "When called from a view, url_for returns
an HTML escaped url. If you need an unescaped url, pass :escape =>
false in the options. "

But I can't seem to get this to work, :escape => true has no effect at
all.  Is this because I'm in an .atom.builder view, not an .html.erb
view, is it somehow different?

Taking the example from the docs itself:

  <%= url_for(:action => 'checkout', :anchor => 'tax&ship', :escape =>
false) %>
  # => /testing/jump/#tax&ship


Not for me.  For me, with that exact call with :escape => true, I still
get:

=> ...checkout#tax%26ship

(tested with ruby-debug itself, in a view. So I know it's not some later
layer escaping it before it gets to the browser or something). Is this a
bug? Is it a bug only in atom.builder or something, or something else i
have yet to isolate? Or am I doing something wrong? Any advice?
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Rails 3 Routing problem

2010-05-20 Thread Conrad Taylor
On Thu, May 20, 2010 at 12:57 PM, Adam Leonard  wrote:

> I have moved some of my development on to my server.
> http://ls1.bigseapreview.com . The homepage works just fine, but any
> other route isn't correctly working.
>
> If I attempt to go to http://ls1.bigseapreview.com/about, it throws a
> 404, but this all works locally.
>
> I'm using Phusion Passenger, if that helps at all. I'm not quite sure
> what to do to fix this problem, but at the moment I am forced to use
> this subdomain.
>

Please post the routes file or the relevant sections of it to better assist
you?

-Conrad


> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Rails 3 Routing problem

2010-05-20 Thread Adam Leonard
I have moved some of my development on to my server.
http://ls1.bigseapreview.com . The homepage works just fine, but any
other route isn't correctly working.

If I attempt to go to http://ls1.bigseapreview.com/about, it throws a
404, but this all works locally.

I'm using Phusion Passenger, if that helps at all. I'm not quite sure
what to do to fix this problem, but at the moment I am forced to use
this subdomain.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Install eventmachine on Debian Lenny

2010-05-20 Thread Jeffrey L. Taylor
Do you have libc6-dev installed?

Jeffrey

Quoting Juan José Vidal :
> Hi,
> 
> I can't install eventmachine on Debian Lenny. ruby-dev and
> build-essential are installed. Where's the problem?
[snip]
> -DHAVE_RB_TIME_NEW -DOS_UNIX -DWITHOUT_SSL -I/include/include-fPIC
> -fno-strict-aliasing -g -g -O2  -fPIC-c files.cpp
> In file included from /usr/include/c
> ++/4.3/x86_64-linux-gnu/bits/os_defines.h:44,
>  from /usr/include/c++/4.3/x86_64-linux-gnu/bits/c
> ++config.h:40,
>  from /usr/include/c++/4.3/iostream:44,
>  from project.h:29,
>  from files.cpp:20:
> /usr/include/features.h:330:25: error: sys/cdefs.h: No existe el fichero
> o el directorio
[snip]

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Re: nill object error

2010-05-20 Thread Colin Law
On 20 May 2010 17:19, Ravi Dtv  wrote:
>...>
> When debugging i find currentgroupid is nill.
>
> How can I solve this. Possible solutions to pass values form partial to
> controller.
>        <% @groups.each do |g| %>
>   
> 
>     <%= link_to_remote g.group_name, :update => "abc", :url => {
> :controller =>
>  "users" , :action => "showfriendslist" } %>
>
>   <%= hidden_field_tag :group_name  %>
> 
> 
> <% end %>
>
> I can see my groupname displaying in my page, but when I click on my
> groupname link, Im not able to pass  groupname to my controller.

Using a hidden field does not work as you are not in a form.  That is
how to do it if you were submitting from a form.  Instead just include
the name in the url - something like
 <%= link_to_remote g.group_name, :update => "abc", :url => {
:controller => "users" , :action => "showfriendslist", :group_name =>
g.group_name } %>

Look at the html generated by this to check that it is being included correctly.

Colin

>
>
> My controller:
>
>  def showfriendslist
>
>   @currentgroupid=Group.find_by_group_name(params[:group_name]).id
>
> �...@friendsingroup=groupfriend.find_all_by_user_id_and_group_id(current_user.id,@currentgroupid)
>
>  respond_to do |format|
>  format.html {render :partial => "friendlist" }
>
>  format.xml
>  end

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Active Scaffold Filtered Export

2010-05-20 Thread May Pie
I'm new to Rails, and I'm not sure how I can pass the results of a
filtered list to my export.  I'm filtering using several user-selected
criteria run through a conditions_for_collection.  Then I'm using a
config.actions_link.add to link to an Export function.

How can I export just my filtered list?
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Problem with installation of Rails 3

2010-05-20 Thread Jeff
On May 20, 9:26 am, Siva Kilaru  wrote:
> I had one more problem. I dont want to use sqlite3 instead want to use
> Postgresql...
>
> Do u have any idea of how to do it..
>
> I think I installed all the required gems
>
> I want to modify the database.yml file which I did but even cant get the
> things done!!

If you have already generated the app, you need a section like this in
your database.yml:

development:
   adapter: postgresql
   host: localhost   # or your server name
   database: my_app_development
   username: me
   password: password

and similarly change the test and production sections too.

Once you've done that, you can use rake db:create to automatically
create your local postgres database which I think is pretty cool.

In the future, when you create a new Rails app, you can use the -d
option to specify postgresql, which will generate the database.yml for
you from the beginnning.

Jeff

purpleworkshops.com

> Someone or other please help me out in this as well
>
> Siva
> --
> Posted viahttp://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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] inline RJS ActionControllerException: "stack level too deep"

2010-05-20 Thread Lille
Hi,

I get a ActionControllerException: "stack level too deep" when I
attempt inline RJS like this:

<%=observe_field("loan_term",  :function => update_page { |page|
page[:max_term_in_yrs].insert_html(page[:loan_term].value/12); })%>

What am I missing -- where's the wind?

Thanks,

Lille

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: spree commerce (or other open source ruby shopping carts)

2010-05-20 Thread Yiannis
Spree has nice architecture and logic with extensions, but currently
it has many bugs. It is in version 0.10... I was impressed by his
architecture but dissapointed by the bugs :(. I started to fix them,
it wasn't difficult to fix what bug I found but I was thinking if it
has so many bugs now that I started, what I will find out later so I
decided to go with a custom eshop (and when rails 3.0 comes out, make
it rails 3 and give it open source... but it is very simple in
comparison with spree).



On 20 Μάϊος, 18:38, "mgerstenbl...@gmail.com"
 wrote:
> Hi All,
>
> Has anyone used spree commerce as an e-commerce system? Is it production
> ready? Easy to customize? Are there other ruby-based platforms out there?
>
> I'm currently looking at options for an e-commerce system for a venture my
> company is starting and we're deciding whether to use existing open-source
> solutions, proprietary software, or to just roll our own. Any insight would
> be greatly appreciated.
>
> Thanks,
>
> Mike
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] using searchlogic to retrieve ids, then rebuild object?

2010-05-20 Thread Conrad Taylor
On Thu, May 20, 2010 at 11:38 AM, dan  wrote:

> im giving searchlogic a try to combine named scopes easily
> only issue i have is it doesnt return distinct results
> ive worked around this with a named scope of grouped which selects
> only the id and groups by the id
> once ive got the ids, how can i quickly rebuild the
> object...find(:id=>[...@ids]...or something similar?
>
>
What's the actual code to your query that uses Searchlogic?  This will help
other to better assist you.

-Conrad


> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Looking for Easy Rails hosting

2010-05-20 Thread Deon Silva
I would recommend webappcabaret.com.
They have RAILS already setup to run on Mongrel, Passenger as well as 
Glassfish.
Price start at $10 per month. And you are still able to use cPanel or 
Plesk
for general website management.
Mohammed Alenazi wrote:
> Hi
> 
> I have registered for some paid rails hosting  system that uses cpanel
> to deploy the rails apps. I could not deploy my app/ I tried several
> times with no success.
> 
> Does any one know a good hosting company that provide guidelines or
> tutorial on how to deploy that rails apps on their servers?

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Rendering a partial on a two column page

2010-05-20 Thread Matt Royer
Hi,

I attached a page for clarity of what I want.

I have a two column page (index.html.erb). On the left hand side, I have
the order ID and order NAME displayed. There is a SHOW link next to each
entry.

I want to be able to click on the SHOW link and have it display the full
order information on the right hand column (this is the show.html.erb
file that Rails generated). I turned the default Rails generated
show.html.erb file into a partial.

I'm sure this has to use link_to_remote on the SHOW link, but I'm not
sure how to make it update the right hand column with the partial. I've
read through a lot of the Rails API info jumping around to Helpers,
remote_function and other things. I'm sure I'm missing something simple.

Any help would be appreciated.

Attachments:
http://www.ruby-forum.com/attachment/4746/ScreenShot003.jpg

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] using searchlogic to retrieve ids, then rebuild object?

2010-05-20 Thread dan
im giving searchlogic a try to combine named scopes easily
only issue i have is it doesnt return distinct results
ive worked around this with a named scope of grouped which selects
only the id and groups by the id
once ive got the ids, how can i quickly rebuild the
object...find(:id=>[...@ids]...or something similar?

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Basic question on RoR, the Web, and Browsers

2010-05-20 Thread Frederick Cheung


On May 20, 6:23 pm, Ralph Shnelvar  wrote:
> First of all, thank you about the info about the tcp connection.  Can
> you point me at any additional information about that, please?
>

Not that I can think of - it's just how  people write network software

> > One way of doing things might be for there to be a games table, and
> > pass the id of the game either in the url or stash it in the session
> > (session not so hot if this is actually going to be two tabs in the
> > same browser)
>
> When on stores it in the session, where is that stored???
>
> I am still very lost as to what a session is.  Is there a good article
> you could recommend?
>

http://guides.rubyonrails.org/security.html#sessions

Fred
> Ralph
>
> --
> Posted viahttp://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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Ruby on Rails Developer - 6 month contract in Portland, OR *some travel involved

2010-05-20 Thread Patrick - PDX Recruiter
Immemdiate need for a RoR Developer, details below. Looking for person
located in Oregon (ideally) and will require some travel to Washington
D.C then rest will be remote/work from home.

if you are interested, send a resume to; patri...@infogroupnw.com


Develop and maintain Ruby on Rails application. You will work on a
team of 3 developers coding an application. At first this will include
some review and refactoring of an existing code base. As part of the
refactoring process you may initially conduct an informal usability
study with a few keys users. As part of the maintenance process you
will continue to work closely with key users while developing new
features and resolving bug reports. Since you will be working on a
small team you will get your hands into all areas of web application
development, from design to deployment. The position will include
continuing maintenance and support of the production environment. You
will have the opportunity to work with a large data set in an
application used by hundreds of thousands of users. You will have the
opportunity to deal with substantial scaling and data mining
objectives in addition to your normal work flow.

Qualifications

Experience with the following technologies:

Ruby
Rails
PostgreSQL
Linux
Git
Functional Knowledge of JQuery, css, and related front end
technologies

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Problem with installation of Rails 3

2010-05-20 Thread conradwt
On Thu, May 20, 2010 at 7:26 AM, Siva Kilaru  wrote:

> Jeff Cohen wrote:
> >
> > Pretty sure that's just a documentation error.  Looks like your Rails
> > beta3 gem installed fine.
> >
> > Jeff
>
> Thanx Jeff
>
> I had one more problem. I dont want to use sqlite3 instead want to use
> Postgresql...
>
> Do u have any idea of how to do it..
>
> I think I installed all the required gems
>
> I want to modify the database.yml file which I did but even cant get the
> things done!!
>
> Someone or other please help me out in this as well
>
> Siva
>

Siva, you'll need to following these steps:

a)  Install the PostgreSQL database engine
b)  gem install pg
c)  Update the Gemfile

 gem "pg"

Good luck,

-Conrad

--
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: local stack dump capability would be nice ..

2010-05-20 Thread wbsurf...@yahoo.com
hey, thanks

On May 20, 11:57 am, Frederick Cheung 
wrote:
> On May 20, 4:13 pm, "wbsurf...@yahoo.com"  wrote:
>
> >  If there was a way to limit parts of a ruby stack trace to just my
> > code rather than the whole rails library and gems that would be an
> > interesting feature ..
>
> likehttp://api.rubyonrails.org/classes/ActiveSupport/BacktraceCleaner.html
> ? (Rails will use the instance given by Rails.backtrace_cleaner)
>
> Fred
>
>
>
> > --
> > 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-t...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Basic question on RoR, the Web, and Browsers

2010-05-20 Thread Ralph Shnelvar
First of all, thank you about the info about the tcp connection.  Can 
you point me at any additional information about that, please?

> One way of doing things might be for there to be a games table, and
> pass the id of the game either in the url or stash it in the session
> (session not so hot if this is actually going to be two tabs in the
> same browser)

When on stores it in the session, where is that stored???

I am still very lost as to what a session is.  Is there a good article 
you could recommend?

Ralph

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Basic question on RoR, the Web, and Browsers

2010-05-20 Thread Frederick Cheung


On May 20, 5:45 pm, Ralph Shnelvar  wrote:

> If Google were implemented in Rails, some controller would see the
> request, process it, hand off to a view, and the view would render it.
>
> Basic question:  When the view is rendered and sent back to the client
> browser, how does the browser know what tab to render?
>

The data with the response will come back over the same tcp connection
as the request, and that tcp connection is owned by some object that
knows what to do with the data (a bit more complicated if keep-alive &
pipelineing are involved but that sort of low level detail is probably
just handled by the networking library you sit on top of.

>
> My "web server" is Webrick.
>
> I think I know enough Ajax to make this happen if there were only one
> tab.  That is, if there were only a single "user" and the result was to
> do nothing more than double what the user typed in.
>
> I guess I'm lost as to what a "session" represents here.
>

One way of doing things might be for there to be a games table, and
pass the id of the game either in the url or stash it in the session
(session not so hot if this is actually going to be two tabs in the
same browser)

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Basic question on RoR, the Web, and Browsers

2010-05-20 Thread Ralph Shnelvar
Let's say Firefox has opened two tabs each with Google's home screen on
it.

Now the user enters some text into the form and clicks "Google Search".

If Google were implemented in Rails, some controller would see the
request, process it, hand off to a view, and the view would render it.

Basic question:  When the view is rendered and sent back to the client
browser, how does the browser know what tab to render?

- - - -

Here's my "real" problem.  I am clueless how to implement this.  No,
this is not a homework assignment.

What I want to do is have two tabs (that is, two "users") playing a game
in which the first user enters a number on the left hand side of the
screen.  The second user enters a number on the right hand side of the
screen.

Both users should see what number is entered by the other user and the
sum of the two numbers displayed at the top of the screen.

- - - -

My "web server" is Webrick.

I think I know enough Ajax to make this happen if there were only one
tab.  That is, if there were only a single "user" and the result was to
do nothing more than double what the user typed in.

I guess I'm lost as to what a "session" represents here.

Any guidance and explanations would be vastly appreciated here.

As should be clear from the post, above, I really don't understand how
the pieces fit together.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: get data from has_and_belongs_to_many + has_many

2010-05-20 Thread Ale Ds
> Sharagoz wrote:
> I don't think that is necessary. It should be possible to get the data
> in a single sql query.
> @cs = C.all(:joins => {:b => :as}, :conditions => {'as.id = 1'})
> 

That 's what I was looking for,
I was wrong because I began research from the wrong side (A instead of 
C)

Thank you very much,
Alessandro DS
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: get data from has_and_belongs_to_many + has_many

2010-05-20 Thread Ale Ds
> Michael Pavling wrote:
> 
> You need to iterate over a's bs [1] collection, and return the related
> cs. Then probably only return uniq c records (a given c might be
> linked to more than one b...)
> This should give you what you want:
> 
>   cs=[]
>   a.bs.each do |b|
> cs += b.cs
>   end
>   cs.uniq!
This is the solution that I don't like to use
> 
> and this is the same thing:
>   a.bs.inject {|cs, b| sum + b.cs }.uniq
> 
this looks interesting ! (even if I have to brush up 'inject' :) )
but I am looking for a more simpe solution

thank you,
Alessandro DS


> [1] This is why convention prefers Foo/Bar for example names "a,
> b, c" doesn't make for easy or understandable reading.

Yes, I agree with you (the pluralization of A,B,C is unreadable)
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Facebook, authlogic, and OAuth2

2010-05-20 Thread vov
I recall the author saying he made the new gem as opposed to doing
changes in the original oauth gem because oauth2 is "a different
beast".

I tried to use the oauth2 gem to log-in to twitter, and I confirm -
obviously- it doesn't work.

I'm looking forward Twitter to implement oauth 2.

On May 19, 10:40 pm, "Andrew C."  wrote:
> nice.  I'll be looking forward to that.
>
> Will it play nice with other login options (the old oauth in
> particular, which is still needed for Twitter)?
>
> Cheers,
> Andrew
>
> On May 19, 12:10 am, giovanni  wrote:
>
>
>
>
>
> > I'm working on a new version of authlogic_oauth that will use
> > oauth2...
> > I think it's what you are searching for...
> > It will be released at the end of the week, keep eyes 
> > onhttp://github.com/potomak
>
> > On May 8, 3:52 am, Alex  wrote:
>
> > > Rpx might be good for some people.  It's a single sign-on service that
> > > you pay a nominal fee to use.
>
> > > Doesn't fit the bill for me.  Thanks.
>
> > > On May 7, 1:41 am, swetha  wrote:
>
> > > > Yes ,working with authlogic you can use authlogic_rpx gem to make your
> > > > application login usingfacebookor anyothers.
>
> > > >http://github.com/tardate/rails-authlogic-rpx-sample
>
> > > > For rpxwww.rpx.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-t...@googlegroups.com.
> > > > To unsubscribe from this group, send email to 
> > > > rubyonrails-talk+unsubscr...@googlegroups.com.
> > > > For more options, visit this group 
> > > > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> > > --
> > > 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-t...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > rubyonrails-talk+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> > --
> > 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-t...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Re: nill object error

2010-05-20 Thread Ravi Dtv
Colin Law wrote:
> On 20 May 2010 16:35, Ravi Dtv  wrote:

>>
>> �format.xml
>> "2010-05-17 14:00:13", user_id: 9, group_name: "testinggroup">
>> �from (irb):43
> That is because @friendsingroup is an array because you have used
> find_all_by_...  The clue is in the error message.  It says that class
> Array has not got a method group_id
> 
>>
>> In view I get the following error
>>
>> �RuntimeError in UsersController#showfriendslist
>>
>> Called id for nil, which would mistakenly be 4 -- if you really wanted
>> the id of nil, use object_id
> 
> That means that you have used something.id where id is nil.  You still
> have not told us which line in the view is giving the error.  Look at
> the error message and see which line it is, then look to see what id
> you are using on that line and most likely you will find the nil
> object.  Then you just have to work out why it is nil.  In order to
> avoid your view crashing you could test it for nil and put a message
> in the view instead of allowing it to crash.
> 
> I also suggest also that you have a look at the Rails Guide on
> debugging.  It will show you ways of breaking in to your code to
> inspect the variables.  I use ruby-debug when I have this sort of
> problem.
> 
> Colin



Thanks Colin for the reply.

When debugging i find currentgroupid is nill.

How can I solve this. Possible solutions to pass values form partial to 
controller.
<% @groups.each do |g| %>
   

 <%= link_to_remote g.group_name, :update => "abc", :url => { 
:controller =>
 "users" , :action => "showfriendslist" } %>

   <%= hidden_field_tag :group_name  %>


<% end %>

I can see my groupname displaying in my page, but when I click on my 
groupname link, Im not able to pass  groupname to my controller.


My controller:

 def showfriendslist

   @currentgroupid=Group.find_by_group_name(params[:group_name]).id

 
#...@friendsingroup=groupfriend.find_all_by_user_id_and_group_id(current_user.id,@currentgroupid)

  respond_to do |format|
  format.html {render :partial => "friendlist" }

  format.xml
  end


 end

Please help. Thank you.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: get data from has_and_belongs_to_many + has_many

2010-05-20 Thread Sharagoz
On May 20, 4:13 pm, Michael Pavling  wrote:
> You need to iterate over a's bs [1] collection, and return the related
> cs.

I don't think that is necessary. It should be possible to get the data
in a single sql query.
@cs = C.all(:joins => {:b => :as}, :conditions => {'as.id = 1'})

> [1] This is why convention prefers Foo/Bar for example names "a,
> b, c" doesn't make for easy or understandable reading.

I second that

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] spree commerce (or other open source ruby shopping carts)

2010-05-20 Thread Andrew Kuklewicz
Haven't used spree.

We use active merchant + paypal, but it is not a very big part of our site -
it works and we leave it alone.
Not sure what you are doing, but shopify might be an option as well.

Cheers,

Andrew Kuklewicz


On Thu, May 20, 2010 at 11:38 AM, mgerstenbl...@gmail.com <
mgerstenbl...@gmail.com> wrote:

> Hi All,
>
> Has anyone used spree commerce as an e-commerce system? Is it production
> ready? Easy to customize? Are there other ruby-based platforms out there?
>
> I'm currently looking at options for an e-commerce system for a venture my
> company is starting and we're deciding whether to use existing open-source
> solutions, proprietary software, or to just roll our own. Any insight would
> be greatly appreciated.
>
> Thanks,
>
> Mike
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: nill object error

2010-05-20 Thread Colin Law
On 20 May 2010 16:35, Ravi Dtv  wrote:
> Ar Chron wrote:
>> Ravi Dtv wrote:
>>>
>>>  def grouplist
>>>
>>>
>>> @currentgroupid=Group.find_by_group_name(params[:group_name])
>>> @currentgroupfriends=GroupFriend.find_all_by_user_id_and_group_id(current_user.id,@currentgroupid)
>>>
>>>  format.html {redirect_to :back}
>>>
>>>  end
>>
>> What does the log tell you is nil? current_user or @currentgroupid?
>>
>> a. You're assuming that @currentgroupid will always have a value, which
>> may be okay depending on the source of params[:group_name], which we
>> don't know.
>>
>> b. What is populating current_user?  Is that the source of the nil
>> error?
>
> Thanks for your reply
>
>  def showfriendslist
>
> �...@currentgroupid=group.find_by_group_name(params[:group_name]).id
> @friendsingroup=GroupFriend.find_all_by_user_id_and_group_id(current_user.id,
> @currentgroupid)
>
>  respond_to do |format|
>  format.html {render :partial => "friendlist" }
>  format.xml
>
>  end
>
> This is my controller. My current_user is the current logged in user.
> I can get the groupid value into @currentgroupid.
>
> When I tried in console
>
>>> @currentgroupid=Group.find_by_group_name('testinggroup')
> => # "2010-05-17 14:00:13", user_id: 9, group_name: "testinggroup">
>>> @currentgroupid.id
> => 23
>>> �...@friendsingroup=groupfriend.find_all_by_user_id_and_group_id('9',@currentgroupid.id
>>>  )
> => [# "2010-05-19 04:36:21", group_id: 23, friend_id: 4, user_id: 9>]
>>> @friendsingroup.id
> (irb):42: warning: Object#id will be deprecated; use Object#object_id
> => -618448038
>>> @friendsingroup.group_id
> NoMethodError: undefined method `group_id' for #
>  from (irb):43

That is because @friendsingroup is an array because you have used
find_all_by_...  The clue is in the error message.  It says that class
Array has not got a method group_id

>
> In view I get the following error
>
>  RuntimeError in UsersController#showfriendslist
>
> Called id for nil, which would mistakenly be 4 -- if you really wanted
> the id of nil, use object_id

That means that you have used something.id where id is nil.  You still
have not told us which line in the view is giving the error.  Look at
the error message and see which line it is, then look to see what id
you are using on that line and most likely you will find the nil
object.  Then you just have to work out why it is nil.  In order to
avoid your view crashing you could test it for nil and put a message
in the view instead of allowing it to crash.

I also suggest also that you have a look at the Rails Guide on
debugging.  It will show you ways of breaking in to your code to
inspect the variables.  I use ruby-debug when I have this sort of
problem.

Colin

>
>
> Please help.. Im new to Ruby on Rails.
>
> Thank you.
>
>
>  end
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: local stack dump capability would be nice ..

2010-05-20 Thread Frederick Cheung


On May 20, 4:13 pm, "wbsurf...@yahoo.com"  wrote:
>  If there was a way to limit parts of a ruby stack trace to just my
> code rather than the whole rails library and gems that would be an
> interesting feature ..

like http://api.rubyonrails.org/classes/ActiveSupport/BacktraceCleaner.html
? (Rails will use the instance given by Rails.backtrace_cleaner)

Fred
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Rails vs Grails

2010-05-20 Thread Björn Wilmsmann
Hi,

On 20 May 2010 08:10, egervari  wrote:

> Hi, are there any really unbiased comparisons between rails and
> grails, and to which each framework is better suited for?

Having worked with both extensively, though a lot more with Grails as
of lately, I dare say that it all boils down to a matter of personal
taste. There is no way to objectively say which one's better.

Each has its own advantages and gotchas. There are things which are
very easy with Grails (as in 'install plugin and your done') like
implementing login facilities or running jobs. However, there are also
things that are equally easy with Rails which are not so easy with
Grails.

At my company we mostly use Grails and for very good reasons but there
sure are just as many good reasons for using Rails.

> 1) The tests take forever to run

This is a well-known problem. The cause for this is JVM startup time.
For the time being Grails offers an interactive mode that starts a JVM
and allows you to run commands like test-app without incurring a JVM
startup penalty for each run. Besides, the Grails team is also working
on improving testing in various ways for the next major release.

> 4) It has slow code->browser cycles.. and sometimes you gotta restart
> tomcat anyway because the class loading blows up. It happens a lot
> more than they say it does.

This used to be a problem with 1.0.x and 1.1.x but shouldn't really
occur anymore nowadays. At least it doesn't for us and we do a lot of
Grails development

-- 
Best regards,
Björn Wilmsmann

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Postgres + Rail 3.0

2010-05-20 Thread Ravi Dtv
Siva Kilaru wrote:
> Hi guys,
> 
> I am really new to these things like ROR and Postgres.
> 
> When I was installing ROR 3.0 it says
> 
> Successfully installed rails 3.0.0 beta
> 1 gem installed
> Installing ri document for rails 3.0.0 beta
> File not Found: lib
> 
> This is the one which I really dont understand and dont know what to do?
> Help me out guys plz...
> 
> And I want to configure the database with postgresql and I want to know
> how it works...


For PostgreSQL try this
to install the following gem to use postgresql: install gem postgres-pr

Go through the link and scroll down for Installing PosgreSQL
http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition

Hope this helps you.
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] spree commerce (or other open source ruby shopping carts)

2010-05-20 Thread mgerstenbl...@gmail.com
Hi All,

Has anyone used spree commerce as an e-commerce system? Is it production
ready? Easy to customize? Are there other ruby-based platforms out there?

I'm currently looking at options for an e-commerce system for a venture my
company is starting and we're deciding whether to use existing open-source
solutions, proprietary software, or to just roll our own. Any insight would
be greatly appreciated.

Thanks,

Mike

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: nill object error

2010-05-20 Thread Ravi Dtv
Ar Chron wrote:
> Ravi Dtv wrote:
>> 
>>  def grouplist
>> 
>> 
>> @currentgroupid=Group.find_by_group_name(params[:group_name])
>> @currentgroupfriends=GroupFriend.find_all_by_user_id_and_group_id(current_user.id,@currentgroupid)
>> 
>>  format.html {redirect_to :back}
>> 
>>  end
> 
> What does the log tell you is nil? current_user or @currentgroupid?
> 
> a. You're assuming that @currentgroupid will always have a value, which 
> may be okay depending on the source of params[:group_name], which we 
> don't know.
> 
> b. What is populating current_user?  Is that the source of the nil 
> error?

Thanks for your reply

 def showfriendslist

 @currentgroupid=Group.find_by_group_name(params[:group_name]).id
@friendsingroup=GroupFriend.find_all_by_user_id_and_group_id(current_user.id, 
@currentgroupid)

 respond_to do |format|
  format.html {render :partial => "friendlist" }
  format.xml

  end

This is my controller. My current_user is the current logged in user.
I can get the groupid value into @currentgroupid.

When I tried in console

>> @currentgroupid=Group.find_by_group_name('testinggroup')
=> #
>> @currentgroupid.id
=> 23
>>  
>> @friendsingroup=GroupFriend.find_all_by_user_id_and_group_id('9',@currentgroupid.id
>>  )
=> [#]
>> @friendsingroup.id
(irb):42: warning: Object#id will be deprecated; use Object#object_id
=> -618448038
>> @friendsingroup.group_id
NoMethodError: undefined method `group_id' for #
  from (irb):43

In view I get the following error

 RuntimeError in UsersController#showfriendslist

Called id for nil, which would mistakenly be 4 -- if you really wanted 
the id of nil, use object_id


Please help.. Im new to Ruby on Rails.

Thank you.


 end
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: URGENT! can't activate actionpack (= 1.13.6, runtime) for ["actionwebservice-1.2.6"], already activated actionpack-2.3.5 for ["rails-2.3.5"] (Gem::LoadError)

2010-05-20 Thread pepe
Thanks again Fred.

On May 20, 11:09 am, Frederick Cheung 
wrote:
> On May 20, 3:51 pm, pepe  wrote:
>
> > > as i understand it it's just the 'old' actionwebservice updated to
> > > still work with recent versions of rails. You might have to install
> > > the gem by hand (get the source, build the gem with gem build
> > > blah.gemspec and then install the resulting .gem file)
>
> > I'll have to give it a try. Never built a gem from source before,
> > though. Could be fun. I wish I had more time.
>
> > > To run with rails 2.3.5 you would at the very least update the gem to
> > > require that version of actionpack/activesupport etc. There are forks
> > > of that gem that purport to have done that
>
> > I am guessing that would be just replacing the value of the version
> > number required? I love Ruby but I'd rather not mess with code that is
> > not mine or I don't understand.
>
> At the very minimum. I don't think rails would have changed much in
> the sort of ways that would affect this between 2.3.5 and 2.3.2. Some
> of the forks seem to have done that change already.
>
> Fred
>
>
>
> > Thanks a lot Fred.
>
> > --
> > 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-t...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] CruiseControl.rb Ruby 1.9.1 compatibility?

2010-05-20 Thread Kristof Redei
Hi all,

I'm trying to add a CruiseControl.rb 1.4.0 project under Ruby 1.9.1p378
and getting an error that seems to indicate the vendored version of
Rails isn't compatible with 1.9 (using the old when syntax with a
colon). Stacktrace below. I'm a bit confused though as I thought this
version of CC.rb was compatible with 1.9. Am I doing something wrong
here?

/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/activesupport/lib/active_support.rb:29:in
`require':
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/activesupport/lib/active_support/inflector.rb:266:
syntax error, unexpected ':', expecting keyword_then or ',' or ';' or
'\n' (SyntaxError)
when 1: "#{number}st"
   ^
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/activesupport/lib/active_support/inflector.rb:267:
syntax error, unexpected keyword_when, expecting keyword_end
when 2: "#{number}nd"
^
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/activesupport/lib/active_support/inflector.rb:268:
syntax error, unexpected keyword_when, expecting keyword_end
when 3: "#{number}rd"
^
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/activesupport/lib/active_support/inflector.rb:273:
syntax error, unexpected keyword_end, expecting $end
from
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/activesupport/lib/active_support.rb:29:in
`'
from
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/actionpack/lib/action_controller.rb:30:in
`require'
from
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/actionpack/lib/action_controller.rb:30:in
`'
from
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/railties/lib/initializer.rb:162:in
`require'
from
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/railties/lib/initializer.rb:162:in
`block in require_frameworks'
from
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/railties/lib/initializer.rb:162:in
`each'
from
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/railties/lib/initializer.rb:162:in
`require_frameworks'
from
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/railties/lib/initializer.rb:83:in
`process'
from
/export/home/users/ci/cruisecontrol-1.4.0/vendor/rails/railties/lib/initializer.rb:43:in
`run'
from
/export/home/users/ci/cruisecontrol-1.4.0/config/environment.rb:15:in
`'
from
/export/home/users/ci/cruisecontrol-1.4.0/lib/cruise_control/../../script/add_project:69:in
`require'
from
/export/home/users/ci/cruisecontrol-1.4.0/lib/cruise_control/../../script/add_project:69:in
`'
from
/export/home/users/ci/cruisecontrol-1.4.0/lib/cruise_control/init.rb:43:in
`load'
from
/export/home/users/ci/cruisecontrol-1.4.0/lib/cruise_control/init.rb:43:in
`add'
from
/export/home/users/ci/cruisecontrol-1.4.0/lib/cruise_control/init.rb:10:in
`run'
from ./cruise:5:in `'
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] local stack dump capability would be nice ..

2010-05-20 Thread wbsurf...@yahoo.com

 If there was a way to limit parts of a ruby stack trace to just my
code rather than the whole rails library and gems that would be an
interesting feature ..

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: URGENT! can't activate actionpack (= 1.13.6, runtime) for ["actionwebservice-1.2.6"], already activated actionpack-2.3.5 for ["rails-2.3.5"] (Gem::LoadError)

2010-05-20 Thread Frederick Cheung


On May 20, 3:51 pm, pepe  wrote:
> > as i understand it it's just the 'old' actionwebservice updated to
> > still work with recent versions of rails. You might have to install
> > the gem by hand (get the source, build the gem with gem build
> > blah.gemspec and then install the resulting .gem file)
>
> I'll have to give it a try. Never built a gem from source before,
> though. Could be fun. I wish I had more time.
>
> > To run with rails 2.3.5 you would at the very least update the gem to
> > require that version of actionpack/activesupport etc. There are forks
> > of that gem that purport to have done that
>
> I am guessing that would be just replacing the value of the version
> number required? I love Ruby but I'd rather not mess with code that is
> not mine or I don't understand.

At the very minimum. I don't think rails would have changed much in
the sort of ways that would affect this between 2.3.5 and 2.3.2. Some
of the forks seem to have done that change already.

Fred
>
> Thanks a lot Fred.
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: URGENT! can't activate actionpack (= 1.13.6, runtime) for ["actionwebservice-1.2.6"], already activated actionpack-2.3.5 for ["rails-2.3.5"] (Gem::LoadError)

2010-05-20 Thread pepe
> as i understand it it's just the 'old' actionwebservice updated to
> still work with recent versions of rails. You might have to install
> the gem by hand (get the source, build the gem with gem build
> blah.gemspec and then install the resulting .gem file)

I'll have to give it a try. Never built a gem from source before,
though. Could be fun. I wish I had more time.

> To run with rails 2.3.5 you would at the very least update the gem to
> require that version of actionpack/activesupport etc. There are forks
> of that gem that purport to have done that

I am guessing that would be just replacing the value of the version
number required? I love Ruby but I'd rather not mess with code that is
not mine or I don't understand. ;)

Thanks a lot Fred.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: URGENT! can't activate actionpack (= 1.13.6, runtime) for ["actionwebservice-1.2.6"], already activated actionpack-2.3.5 for ["rails-2.3.5"] (Gem::LoadError)

2010-05-20 Thread Frederick Cheung


On May 20, 3:05 pm, pepe  wrote:
> Thanks Fred,
>
> I tried to install the last version from datanoise by running "gem
> install/update actionwebservice" but that got me nowhere (still
> showing actionwebservice 1.2.6). Is that not the install command from
> datanoise's gem?
>
> If datanoise's gem is not the same as the 'regular' actionwebservice,
> will I need to change my code or is datanoise the "evolution" of the
> original actionwebservice?

as i understand it it's just the 'old' actionwebservice updated to
still work with recent versions of rails. You might have to install
the gem by hand (get the source, build the gem with gem build
blah.gemspec and then install the resulting .gem file)

>
> You mentioned 2.3.2. If I were able to install that gem version, would
> I have to work with rails 2.3.2 as well?

To run with rails 2.3.5 you would at the very least update the gem to
require that version of actionpack/activesupport etc. There are forks
of that gem that purport to have done that

Fred
>
> wrote:
>
>
>
>
>
> > On May 20, 1:44 pm, pepe  wrote:
>
> > > Another post mentioned about getting rid of any actionpack gem higher
> > > than the one required by actionwebservice but I am afraid that doing
> > > so will screw up actionsupport and/or activerecord.
>
> > > Below is the list of gems currently installed. I would appreciate any
> > > help as I am kind of stuck and need to get this thing done asap.
> > > Thanks in advance
>
> > The core issue is that you have actionwebservice 1.2.6 which requires
> > active support 1.2.6 but this rest of rails requires active support
> > 2.3.5 (requires in the sense that gem dependencies specify those
> > versions).
>
> > You could look athttp://github.com/datanoise/actionwebservice-looks
> > like it was updated to be inline with 2.3.2 and i'm pretty sure
> > changes since 2.3.2 that might affect this have been minimal
>
> > Fred
>
> > > *** LOCAL GEMS ***
>
> > > actionmailer (2.3.5, 2.2.2)
> > > actionpack (2.3.5, 2.2.2, 1.13.6, 1.13.3)
> > > actionwebservice (1.2.6, 1.2.3)
> > > activerecord (2.3.5, 2.2.2, 1.15.6, 1.15.3)
> > > activerecord-oracle-adapter (1.0.0.9250)
> > > activerecord-oracle_enhanced-adapter (1.2.3)
> > > activerecord-sqlserver-adapter (2.3.5)
> > > activeresource (2.3.5, 2.2.2)
> > > activesupport (2.3.5, 2.3.3, 2.2.2, 1.4.4, 1.4.2)
> > > archive-tar-minitar (0.5.2)
> > > authlogic (2.1.3)
> > > builder (2.1.2)
> > > calendar_date_select (1.15, 1.13)
> > > cgi_multipart_eof_fix (2.5.0)
> > > color (1.4.0)
> > > cucumber (0.6.2)
> > > diff-lcs (1.1.2)
> > > fastthread (1.0.1)
> > > fxri (0.3.6)
> > > fxruby (1.6.6)
> > > gem_plugin (0.2.3)
> > > hoe (1.8.2)
> > > hpricot (0.4)
> > > ibm_db (1.1.1)
> > > json_pure (1.2.0)
> > > linecache (0.43)
> > > log4r (1.0.5)
> > > mongrel (1.1.5)
> > > mongrel_service (0.3.4)
> > > mysql (2.7.3)
> > > paginator (1.1.1)
> > > pdf-writer (1.1.8)
> > > polyglot (0.2.9)
> > > rack (1.0.1)
> > > railroad (0.5.0)
> > > rails (2.3.5, 2.2.2)
> > > rake (0.8.7, 0.8.3)
> > > rspec (1.3.0)
> > > ruby-debug-base (0.10.3, 0.10.2)
> > > ruby-debug-ide (0.4.5, 0.3.1)
> > > rubyforge (1.0.3, 1.0.2, 1.0.1)
> > > rubygems-update (1.3.6, 1.3.5, 1.3.1)
> > > sources (0.0.1)
> > > sqlite3-ruby (1.2.1)
> > > term-ansicolor (1.0.4)
> > > transaction-simple (1.4.0)
> > > treetop (1.4.3)
> > > win32-api (1.4.6)
> > > win32-clipboard (0.4.1)
> > > win32-dir (0.3.1)
> > > win32-eventlog (0.4.3)
> > > win32-file (0.5.3)
> > > win32-file-stat (1.2.3)
> > > win32-process (0.5.1)
> > > win32-sapi (0.1.3)
> > > win32-service (0.7.1, 0.5.2)
> > > win32-sound (0.4.0)
> > > win32console (1.2.0)
> > > windows-api (0.4.0)
> > > windows-pr (1.0.9, 0.6.2)
>
> > > --
> > > 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-t...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > rubyonrails-talk+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> > --
> > 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-t...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To

[Rails] Re: Printed/PDF Reports (Text/Tabular/Summary) in Rails

2010-05-20 Thread Anooj Mr
DC...

I am also struggling with integration of BIRT into an ROR project that I 
am working on.. But it seems like there is no or very little 
documentation or resource online for reference.. Can you please point me 
in the right direction here.. I would really appreciate any help..

Thanks

Anooj

DC wrote:
> Jeremy ...
> 
> I have been using the Eclipse BIRT project to create my runtime reports 
> for ROR applications.  Eclipse BIRT needs Tomcat (or other J2EE server) 
> to host.  I use ROR as the front end to capture any filter requirements 
> that the user has, then I call BIRT with the appropriate filter 
> parameters and additional tags to produce HTML or PDF report.
> 
> Hope this helps ...
> 
> DC
> 
> Jeremy Cowgar wrote:
>> The recent discussion about different graphing solutions made me
>> think. What is everyone using for general reports? Currently I have a
>> web based application at work that has roughly 20 different reports
>> ranging from simple tabular data with totaling at the bottom to
>> pretty, colorized, graphic logo's,etc... going to clients, and
>> finally complex ones I hate to think about such as medical forms.
>> 
>> The app is currently written in Python and I use ReportLab. I am
>> slowly replacing that app with rails, converting one section at a
>> time into logical rails controllers. So right now, some "modules" are
>> rails, most are still python, including the reporting side of things.
>> 
>> Any suggestions? I have used FOP in the past and there is no way it's
>> powerful enough for some of the things we do. In some synarios, we
>> really had to push the limits of ReportLab (and sometimes confined by
>> them).
>> 
>> Thanks!
>> 
>> Jeremy

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Problem with installation of Rails 3

2010-05-20 Thread Siva Kilaru
Jeff Cohen wrote:
> 
> Pretty sure that's just a documentation error.  Looks like your Rails
> beta3 gem installed fine.
> 
> Jeff

Thanx Jeff

I had one more problem. I dont want to use sqlite3 instead want to use 
Postgresql...

Do u have any idea of how to do it..

I think I installed all the required gems

I want to modify the database.yml file which I did but even cant get the 
things done!!

Someone or other please help me out in this as well

Siva
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Integrating with BIRT Reporting Engine

2010-05-20 Thread Anooj Mr
Jonathan Viney wrote:
> I looked at this recently but hit a showstopper when dealing with XML 
> data
> sources in BIRT:
> 
> http://dev.eclipse.org/newslists/news.eclipse.birt/msg13195.html
> 
> Any solutions to this?
> 
> -Jonathan.

Has anyone found a solution to this problem yet.. I am working on a 
project where we decided to intergrate BIRT for our reporting.. And i 
cannot find any documentation what so ever anywhere online.. Has anyone 
successfully integrated BIRT to a Rails Project? If so i would really 
appreciate any help you can give me..

Thanks in advance..

Anooj
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Problem with installation of Rails 3

2010-05-20 Thread Jeff
On May 20, 9:11 am, Siva Kilaru  wrote:
> Help me out guys
>
> While installing rails 3 i got the following message
>
> :~$ sudo gem install rails --pre
>
> Successfully installed rails-3.0.0.beta3
> 1 gem installed
> Installing ri documentation for rails-3.0.0.beta3...
> File not found: lib

Pretty sure that's just a documentation error.  Looks like your Rails
beta3 gem installed fine.

Jeff

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] get data from has_and_belongs_to_many + has_many

2010-05-20 Thread Michael Pavling
On 20 May 2010 15:00, Ale Ds  wrote:
> Question:
> How can I get C entries in relationship to an A entry ?
>
> in other words, I have
> a = A.find id
>
> and I want C

You need to iterate over a's bs [1] collection, and return the related
cs. Then probably only return uniq c records (a given c might be
linked to more than one b...)
This should give you what you want:

  cs=[]
  a.bs.each do |b|
cs += b.cs
  end
  cs.uniq!

and this is the same thing:
  a.bs.inject {|cs, b| sum + b.cs }.uniq



[1] This is why convention prefers Foo/Bar for example names "a,
b, c" doesn't make for easy or understandable reading.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Problem with installation of Rails 3

2010-05-20 Thread Siva Kilaru
Help me out guys

While installing rails 3 i got the following message

:~$ sudo gem install rails --pre

Successfully installed rails-3.0.0.beta3
1 gem installed
Installing ri documentation for rails-3.0.0.beta3...
File not found: lib

My gem list

:~$ gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.0.beta3, 2.3.5)
actionpack (3.0.0.beta3, 2.3.5)
activemodel (3.0.0.beta3)
activerecord (3.0.0.beta3, 2.3.5)
activeresource (3.0.0.beta3, 2.3.5)
activesupport (3.0.0.beta3, 2.3.5)
arel (0.3.3, 0.2.pre)
authlogic (2.1.3)
builder (2.1.2)
bundler (0.9.25)
erubis (2.6.5)
ffi (0.6.3)
i18n (0.3.7)
mail (2.2.1, 2.1.5.3)
memcache-client (1.8.3, 1.7.8)
mime-types (1.16)
pg (0.9.0)
polyglot (0.3.1)
postgres (0.7.9.2008.01.28)
rack (1.1.0, 1.0.1)
rack-mount (0.6.3, 0.4.7, 0.4.0)
rack-test (0.5.3)
rails (3.0.0.beta3)
rails3b (3.0.1)
railties (3.0.0.beta3)
rake (0.8.7)
ruby-pg (0.7.9.2008.01.28)
rubygems-update (1.3.7)
SystemTimer (1.2)
text-format (1.0.0)
text-hyphen (1.0.0)
thor (0.13.6)
treetop (1.4.5)
tzinfo (0.3.20)

Please Help me out
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: URGENT! can't activate actionpack (= 1.13.6, runtime) for ["actionwebservice-1.2.6"], already activated actionpack-2.3.5 for ["rails-2.3.5"] (Gem::LoadError)

2010-05-20 Thread pepe
Thanks Fred,

I tried to install the last version from datanoise by running "gem
install/update actionwebservice" but that got me nowhere (still
showing actionwebservice 1.2.6). Is that not the install command from
datanoise's gem?

If datanoise's gem is not the same as the 'regular' actionwebservice,
will I need to change my code or is datanoise the "evolution" of the
original actionwebservice?

You mentioned 2.3.2. If I were able to install that gem version, would
I have to work with rails 2.3.2 as well?

Thanks a lot.

On May 20, 9:55 am, Frederick Cheung 
wrote:
> On May 20, 1:44 pm, pepe  wrote:
>
> > Another post mentioned about getting rid of any actionpack gem higher
> > than the one required by actionwebservice but I am afraid that doing
> > so will screw up actionsupport and/or activerecord.
>
> > Below is the list of gems currently installed. I would appreciate any
> > help as I am kind of stuck and need to get this thing done asap.
> > Thanks in advance
>
> The core issue is that you have actionwebservice 1.2.6 which requires
> active support 1.2.6 but this rest of rails requires active support
> 2.3.5 (requires in the sense that gem dependencies specify those
> versions).
>
> You could look athttp://github.com/datanoise/actionwebservice- looks
> like it was updated to be inline with 2.3.2 and i'm pretty sure
> changes since 2.3.2 that might affect this have been minimal
>
> Fred
>
>
>
> > *** LOCAL GEMS ***
>
> > actionmailer (2.3.5, 2.2.2)
> > actionpack (2.3.5, 2.2.2, 1.13.6, 1.13.3)
> > actionwebservice (1.2.6, 1.2.3)
> > activerecord (2.3.5, 2.2.2, 1.15.6, 1.15.3)
> > activerecord-oracle-adapter (1.0.0.9250)
> > activerecord-oracle_enhanced-adapter (1.2.3)
> > activerecord-sqlserver-adapter (2.3.5)
> > activeresource (2.3.5, 2.2.2)
> > activesupport (2.3.5, 2.3.3, 2.2.2, 1.4.4, 1.4.2)
> > archive-tar-minitar (0.5.2)
> > authlogic (2.1.3)
> > builder (2.1.2)
> > calendar_date_select (1.15, 1.13)
> > cgi_multipart_eof_fix (2.5.0)
> > color (1.4.0)
> > cucumber (0.6.2)
> > diff-lcs (1.1.2)
> > fastthread (1.0.1)
> > fxri (0.3.6)
> > fxruby (1.6.6)
> > gem_plugin (0.2.3)
> > hoe (1.8.2)
> > hpricot (0.4)
> > ibm_db (1.1.1)
> > json_pure (1.2.0)
> > linecache (0.43)
> > log4r (1.0.5)
> > mongrel (1.1.5)
> > mongrel_service (0.3.4)
> > mysql (2.7.3)
> > paginator (1.1.1)
> > pdf-writer (1.1.8)
> > polyglot (0.2.9)
> > rack (1.0.1)
> > railroad (0.5.0)
> > rails (2.3.5, 2.2.2)
> > rake (0.8.7, 0.8.3)
> > rspec (1.3.0)
> > ruby-debug-base (0.10.3, 0.10.2)
> > ruby-debug-ide (0.4.5, 0.3.1)
> > rubyforge (1.0.3, 1.0.2, 1.0.1)
> > rubygems-update (1.3.6, 1.3.5, 1.3.1)
> > sources (0.0.1)
> > sqlite3-ruby (1.2.1)
> > term-ansicolor (1.0.4)
> > transaction-simple (1.4.0)
> > treetop (1.4.3)
> > win32-api (1.4.6)
> > win32-clipboard (0.4.1)
> > win32-dir (0.3.1)
> > win32-eventlog (0.4.3)
> > win32-file (0.5.3)
> > win32-file-stat (1.2.3)
> > win32-process (0.5.1)
> > win32-sapi (0.1.3)
> > win32-service (0.7.1, 0.5.2)
> > win32-sound (0.4.0)
> > win32console (1.2.0)
> > windows-api (0.4.0)
> > windows-pr (1.0.9, 0.6.2)
>
> > --
> > 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-t...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Memory release problem

2010-05-20 Thread Manivannanj Jeganathan
In my application, i have Memory leak problem ie query's execution's
used memory is not released after executing the query.
i have already posted my problem
http://www.ruby-forum.com/topic/209794#new
http://www.ruby-forum.com/topic/209796#new
http://www.ruby-forum.com/topic/209984#new

when i use AR.connection.execute instead of ActiveRecord then i got a
temporarily solution as like

  @result = OfftakeReportingTable.connection.execute("select * from
offtake_reporting_tables limit 10")
  @result.close

Here used memory is released.No problem
but memory is not released if i copied record to another variable like

@result = OfftakeReportingTable.connection.execute("select * from
offtake_reporting_tables limit 10")
  z=[]
  for a in @result
z << a
  end
  @result.close
  z.clear

please give me some ideas to release memory in above problem


Note:
 I used to track free memory and used memory by 'free -m'
command
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] get data from has_and_belongs_to_many + has_many

2010-05-20 Thread Ale Ds
I have 3 models, A, B and C
and the classic 3 relations:
1) A <--- has_and_belongs_to_many ---> B

2) B has_many C

B -> c1
  -> c2
  -> c3
  ...

3) C belong_to B

C -> a1

Question:
How can I get C entries in relationship to an A entry ?

in other words, I have
a = A.find id

and I want C

I have tried
a.bs.cs (NOT correct)
A.bs.all(:include => :cs) (NOT correct)

do you have any solutions ?

thank you,
Alessandro DS
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: URGENT! can't activate actionpack (= 1.13.6, runtime) for ["actionwebservice-1.2.6"], already activated actionpack-2.3.5 for ["rails-2.3.5"] (Gem::LoadError)

2010-05-20 Thread Frederick Cheung


On May 20, 1:44 pm, pepe  wrote:

> Another post mentioned about getting rid of any actionpack gem higher
> than the one required by actionwebservice but I am afraid that doing
> so will screw up actionsupport and/or activerecord.
>
> Below is the list of gems currently installed. I would appreciate any
> help as I am kind of stuck and need to get this thing done asap.
> Thanks in advance
>

The core issue is that you have actionwebservice 1.2.6 which requires
active support 1.2.6 but this rest of rails requires active support
2.3.5 (requires in the sense that gem dependencies specify those
versions).

You could look at http://github.com/datanoise/actionwebservice - looks
like it was updated to be inline with 2.3.2 and i'm pretty sure
changes since 2.3.2 that might affect this have been minimal

Fred
> *** LOCAL GEMS ***
>
> actionmailer (2.3.5, 2.2.2)
> actionpack (2.3.5, 2.2.2, 1.13.6, 1.13.3)
> actionwebservice (1.2.6, 1.2.3)
> activerecord (2.3.5, 2.2.2, 1.15.6, 1.15.3)
> activerecord-oracle-adapter (1.0.0.9250)
> activerecord-oracle_enhanced-adapter (1.2.3)
> activerecord-sqlserver-adapter (2.3.5)
> activeresource (2.3.5, 2.2.2)
> activesupport (2.3.5, 2.3.3, 2.2.2, 1.4.4, 1.4.2)
> archive-tar-minitar (0.5.2)
> authlogic (2.1.3)
> builder (2.1.2)
> calendar_date_select (1.15, 1.13)
> cgi_multipart_eof_fix (2.5.0)
> color (1.4.0)
> cucumber (0.6.2)
> diff-lcs (1.1.2)
> fastthread (1.0.1)
> fxri (0.3.6)
> fxruby (1.6.6)
> gem_plugin (0.2.3)
> hoe (1.8.2)
> hpricot (0.4)
> ibm_db (1.1.1)
> json_pure (1.2.0)
> linecache (0.43)
> log4r (1.0.5)
> mongrel (1.1.5)
> mongrel_service (0.3.4)
> mysql (2.7.3)
> paginator (1.1.1)
> pdf-writer (1.1.8)
> polyglot (0.2.9)
> rack (1.0.1)
> railroad (0.5.0)
> rails (2.3.5, 2.2.2)
> rake (0.8.7, 0.8.3)
> rspec (1.3.0)
> ruby-debug-base (0.10.3, 0.10.2)
> ruby-debug-ide (0.4.5, 0.3.1)
> rubyforge (1.0.3, 1.0.2, 1.0.1)
> rubygems-update (1.3.6, 1.3.5, 1.3.1)
> sources (0.0.1)
> sqlite3-ruby (1.2.1)
> term-ansicolor (1.0.4)
> transaction-simple (1.4.0)
> treetop (1.4.3)
> win32-api (1.4.6)
> win32-clipboard (0.4.1)
> win32-dir (0.3.1)
> win32-eventlog (0.4.3)
> win32-file (0.5.3)
> win32-file-stat (1.2.3)
> win32-process (0.5.1)
> win32-sapi (0.1.3)
> win32-service (0.7.1, 0.5.2)
> win32-sound (0.4.0)
> win32console (1.2.0)
> windows-api (0.4.0)
> windows-pr (1.0.9, 0.6.2)
>
> --
> 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-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: nill object error

2010-05-20 Thread Ar Chron
Ravi Dtv wrote:
> 
>  def grouplist
> 
> 
> @currentgroupid=Group.find_by_group_name(params[:group_name])
> @currentgroupfriends=GroupFriend.find_all_by_user_id_and_group_id(current_user.id,@currentgroupid)
> 
>  format.html {redirect_to :back}
> 
>  end

What does the log tell you is nil? current_user or @currentgroupid?

a. You're assuming that @currentgroupid will always have a value, which 
may be okay depending on the source of params[:group_name], which we 
don't know.

b. What is populating current_user?  Is that the source of the nil 
error?

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] best practices for calling a web service (like geocode)

2010-05-20 Thread chewmanfoo
Guys,

I have a Customer class which creates an instance of an Address class,
and the user can then go into the show method of the Customer class
and associate other addresses with that Customer (sites).  As soon as
an Address instance is created, I want to call geocoding to get the
latitude and longitude of that address so that I can later render a
map of all the sites.  now, I suspect that a call to the geocoding url
synchronously would be a bad thing:

def create
  @address = Address.new(params[:address])
  ... assign other @address parameters
  ...
  create a geocoding instance
  call geocoding, passing in address string, getting back a lat and a
long  <--- wait wait wait wait
  @address.latitude = lat; @address.long = long
end

What's the best practice for doing something like this in ruby/rails?

TIA,

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Parse HTML to text

2010-05-20 Thread Marnen Laibow-Koser
Amala Singh wrote:
> There are many ways.
> 
> One way is Hpricot gem.
> 

That's true, but I think most people are using Nokogiri these days.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Rails vs Grails

2010-05-20 Thread Peter Hickman
On 20 May 2010 13:45, egervari  wrote:

> When it comes to performance, how is Rails? Like if I were to design a
> raw Spring/Hibernate app, which I'm not going to... but let's say I
> did. What is the comparative performance with something like that,
> even though it probably isn't a fair comparison.
>
>
Sorry I do not have sufficient experience to help you with this.



> Also, how well to do the tests run? Imagine a system with a few
> thousand unit/integration tests. How long will it take to get all the
> tests to run?
>
>
This depends on your tests. A massive amount of badly written tests are
going to take a long time to run regardless of the language. The choice of
language is not going to mitigate bad design or coding.



> Is it hard to build cron-like events in rails/ruby? Can I do that
> inside of my app where it's hosted? In the java world, we have quartz
> to do this (and probably some others).
>


We (where I work) are a Linux shop and we use cron extensively to push and
pull data to keep our systems up to date.

Here is the plugin we use
http://github.com/PeterHickman/Crons-for-Railsthere is also some bits
and pieces on my blog if it might help (
http://peter-hickman.blogspot.com/ )

There are other tools but this deploys the crons with the site using
capistrano and installs them all in one go. Works for us.



>
> Also, is it a good idea to use rails 3.0 even if it's in beta if the
> app is not going to production for awhile?
>
>
To be honest we haven't even looked at 3 yet. I'm pretty sure that we have
at least one 2.0.X site still running. I would base your decisions on what
is available now, it's not like all the Rails 2.X code is going to suddenly
stop working the day 3 goes live.

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



  1   2   >