Ruby on Rails Monday, May 31, 2010

Michael^2,

I have faced the same problem, and here is how I solved it, with the
list of failures. Note that I have faced the problem only once on this
particular configuration. Elsewhere (PPC and x86_64) the world is
cloudless.

Configuration:
- OS: Fedora 12
- Arch: PPC64
- Rails 3 pre
- Gem 1.3.6
- Ruby 1.8.8 (I use 1.8.7 on my other machines, but I needed some
extra patches to compile against openssl 1.0---yet another story :-P )

(Fail 1) Installed the gem with Bundler
(Fail 2) Installed the gem with gem, and bundle it with Bundler
(Fail 3) Installed the library manually

Given that my repository assumes we use Bundler, I then did again
(Fail 1). This is the configuration that will work in the following...

At this point, I started to go along the new Rails bootstrap process.
Playing also with IRB (`rails c`) and Rake, I realized that the gems
are all loaded but mysql. The most interesting:

$ rake db:setup --trace #=> Fail
$ rake -r mysql db:setup --trace #=> Success, although all Mysql
constants are flagged as already initialized...

Which confirms a weird behavior with the load process for the mysql
gem, on that particular architecture.

In the Gemfile, I have then bypassed Gem to load the mysql library
directly:

# Database
#gem 'mysql'
require 'mysql'

Doing so everything works fine now. I would like to understand what is
happening but I am a bit short in time now :-( Note that this
modification of the Gemfile is not what we want on all machines. Given
that this PPC64 machine is my production server, a simple conditional
to choose between gem or require may be sufficient, waiting for a
proper fix.

I hope this can help you, but I have a rare architecture these days...
Not sure it is applicable directly.

Eric


On Apr 12, 3:04 pm, Michael Michael <li...@ruby-forum.com> wrote:
> John Grimes wrote:
> > Post up the output of this command:
> > gem list
>
> *** LOCAL GEMS ***
>
> abstract (1.0.0)
> actionmailer (3.0.0.beta2, 2.3.5, 2.2.2, 1.3.6)
> actionpack (3.0.0.beta2, 2.3.5, 2.2.2, 1.13.6)
> actionwebservice (1.2.6)
> activemodel (3.0.0.beta2)
> activerecord (3.0.0.beta2, 2.3.5, 2.2.2, 1.15.6)
> activeresource (3.0.0.beta2, 2.3.5, 2.2.2)
> activesupport (3.0.0.beta2, 2.3.5, 2.2.2, 1.4.4)
> acts_as_ferret (0.4.4, 0.4.3)
> arel (0.3.3)
> builder (2.1.2)
> bundler (0.9.18)
> capistrano (2.5.18, 2.5.2)
> cgi_multipart_eof_fix (2.5.0)
> daemons (1.0.10)
> dnssd (0.6.0)
> erubis (2.6.5)
> fastthread (1.0.1)
> fcgi (0.8.7)
> ferret (0.11.6)
> gem_plugin (0.2.3)
> highline (1.5.2, 1.5.0)
> hpricot (0.6.164)
> i18n (0.3.6)
> libxml-ruby (1.1.2)
> mail (2.2.0, 2.1.5.3)
> memcache-client (1.8.2)
> mime-types (1.16)
> mongrel (1.1.5)
> mysql (2.8.1)
> needle (1.3.0)
> net-scp (1.0.2, 1.0.1)
> net-sftp (2.0.4, 2.0.1, 1.1.1)
> net-ssh (2.0.21, 2.0.4, 1.1.4)
> net-ssh-gateway (1.0.1, 1.0.0)
> polyglot (0.3.1)
> rack (1.1.0, 1.0.1)
> rack-mount (0.6.1)
> rack-test (0.5.3)
> rails (3.0.0.beta2, 2.3.5, 2.2.2, 1.2.6)
> railties (3.0.0.beta2)
> rake (0.8.7, 0.8.3)
> RedCloth (4.1.1)
> ruby-openid (2.1.7, 2.1.2)
> ruby-yadis (0.3.4)
> rubygems-update (1.3.6)
> rubynode (0.1.5)
> sqlite3-ruby (1.2.4)
> termios (0.9.4)
> text-format (1.0.0)
> text-hyphen (1.0.0)
> thor (0.13.4)
> treetop (1.4.5)
> tzinfo (0.3.19)
> xmpp4r (0.5, 0.4)
> --
> 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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi,


I need to create a "Active directory authentication on linux machine"
using ruby on rails.

Can anybody have any idea please?


Regards,

Periyasamy.R
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

That's the ticket! Thank you. a.
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Quoting Joshua Partogi <joshua.partogi@gmail.com>:
> Hi all,
>
>
> I want to be able to display 404 page from a controller when a record
> in the database can not be found. I am using Rails 3 at the moment. I
> tried to find how to do this on guides.rails.info with no luck. Can
> anybody recommend the best approach to do this?
>

Have you tried raising ActiveRecord::NotFound in the controller? Or just let
the model raise it.

Jeffrey

P.S. not actually tried this in Rails 3, this works for me in Rails 1.x and
2.x.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Is there a way to obtain the response body of the last render in
Rails3 beta3?

For example, given:
render :action=>'aaa', :layout=>'bbb'

I had thought something like @_current_render would work but it did
not, it is nil.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hey Guys.

I'm very new with rails and I've been building a CMS application
backend.

All is going well, but I would like to know if this is possible?

Basically I have two models:

@page { id, name, number }

@extended_page { id, page_id, description, image }

The idea is that there are bunch of pages but NOT ALL pages have
extended_content. In the event that there is a page with extended
content then I want to be able to have a form that allows for editing
both of them.

In the controller:

@page = Page.find(params[:id])
@extended= Extended.find(:first, :conditions => ["page_id =
?",@page.id])
@combined = ... #merge the two somehow

So in the view:

<%- form_for @combined do |f| %>

<%= f.label :name %>
<%= f.text_field :name %>

...

<%= f.label :description %>
<%= f.text_field :description %>

<% end >

This way in the controller, there only has to be one model that will be
updated (which will update to both).

Is this possible?
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi all,


I want to be able to display 404 page from a controller when a record
in the database can not be found. I am using Rails 3 at the moment. I
tried to find how to do this on guides.rails.info with no luck. Can
anybody recommend the best approach to do this?

Thanks heaps for your help and assistance. I really appreciate it.

Kind regards,
Joshua

--
http://twitter.com/scrum8

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hmm, http://github.com/zilkey/active_hash looks very cool. And Rails 3
ready. But it do not allow habtm relations :s
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Marnen Laibow-Koser wrote:
> This will probably be easier in Rails 3, but not impossible in Rails 2.
> Which are you using?
>
Thank for your quick answer. I'm using Rails 3 :p
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Paul A. wrote:
> Hi,
>
> I have an ActiveRecord model Group and a YAML table stored in
> config/users.yaml just like:
>
> - {login: titi, password: 123456, group_id: 2}
> - {login: toto, password: 987654, group_id: 7}
>
> And I would like to link them by a sexy way. Can you help me?
>
> I would be happy if I can do this (as example): User.first.group.id # =>
> 2
>
> Many thanks for any help!

This will probably be easier in Rails 3, but not impossible in Rails 2.
Which are you using?

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

Ruby on Rails

Hi,

I have an ActiveRecord model Group and a YAML table stored in
config/users.yaml just like:

- {login: titi, password: 123456, group_id: 2}
- {login: toto, password: 987654, group_id: 7}

And I would like to link them by a sexy way. Can you help me?

I would be happy if I can do this (as example): User.first.group.id # =>
2

Many thanks for any help!
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 31 May 2010 21:55, minka <beesupport@beelucid.com> wrote:
> Thanks for the feedback, actually the line is
>
>  EXEC_RATE = 20  # cents per line, convert and exec
>
> So that could not be it.
>
> I have also checked in my IDE, and the new value is showing up
> in my local development environment.
> The new value is on the production machine, in the production code.
> BUT it is not being displayed in the production site.
> All other changes are being properly displayed.
> This is ruby1.8.6

When I have this sort of problem, one trick I have used is to put an
intentional syntax error in the file and upload it to the production
server, this allows you to check that the file is actually being
loaded.

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

Ruby on Rails

Thanks for the feedback, actually the line is

EXEC_RATE = 20 # cents per line, convert and exec

So that could not be it.

I have also checked in my IDE, and the new value is showing up
in my local development environment.
The new value is on the production machine, in the production code.
BUT it is not being displayed in the production site.
All other changes are being properly displayed.
This is ruby1.8.6
??

thanks!
lucidbee

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

// is not a ruby comment

Change it to # and see what happens.

(Sorry for top-posting - mobile phone has awful email client)

On May 31, 2010 9:31 PM, "minka" <beesupport@beelucid.com> wrote:

A very puzzling thing has happened. Any ideas on this?

I have two rates for this service I provide.

5 cents  per line
10 cents per line

I updated the latter to 20 cents per line, and made other changes
to my site. I use a constant for the rate so I did this:
EXEC_RATE = 20   // used to be, EXEC_RATE = 10

I made other changes to my site, did a successful upload,
stopped and started mongrel, etc.
I have verified that the products_controller on my site has the
new constant value above but I find that the new value does
not show.

I see the old value, 10 cents per line, everywhere.

I am referencing my constant this way throughout my site:
<%= ProductsController::EXEC_RATE.to_s %> cents per line

I flushed my browser cache.
All my other changes have appeared correctly.
I look at the current source in current/app/products_controller.rb
and my constant on the site has the correct value.

What could this be? Any ideas?
thanks!!
lucidbee
























--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

A very puzzling thing has happened. Any ideas on this?

I have two rates for this service I provide.

5 cents per line
10 cents per line

I updated the latter to 20 cents per line, and made other changes
to my site. I use a constant for the rate so I did this:
EXEC_RATE = 20 // used to be, EXEC_RATE = 10

I made other changes to my site, did a successful upload,
stopped and started mongrel, etc.
I have verified that the products_controller on my site has the
new constant value above but I find that the new value does
not show.

I see the old value, 10 cents per line, everywhere.

I am referencing my constant this way throughout my site:
<%= ProductsController::EXEC_RATE.to_s %> cents per line

I flushed my browser cache.
All my other changes have appeared correctly.
I look at the current source in current/app/products_controller.rb
and my constant on the site has the correct value.

What could this be? Any ideas?
thanks!!
lucidbee


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

RichardOnRails wrote:
> Geez, Marnen,
>
> I don't see why people on a list focused on the most famous Ruby app
> would view it beneath themselves to address a fundamental Ruby
> question.
>

It's not that they see it as "beneath themselves". It's simply that
this is a forum for Rails issues, and only for Rails issues. A simple
issue with the Ruby debugger is off topic here. Please ask your
question where it is on topic -- it will get seen by Ruby experts who
are familiar with the debugger but don't necessarily use Rails.

> Incidentally, my question is, in fact, related to a Rails - a Rails
> application.

No. It came up *in the course of* Rails development, but it is not a
Rails-related question as you've presented it.

> My client for the Rails app wants to change a bunch of
> the app's field names. This is a job for a machine, say
> ActiveScaffold, for example. However, despite the documentation from
> ActiveScaffold.com and folks in the ActiveScaffold newsgroup, I still
> don't have that running.

ActiveScaffold is dead simple to use. Perhaps if you were to ask
questions about the problems you're actually having, we could help.

In other words, please explicitly ask the questions you actually want
answered.

>
> Hence, I wrote my own tool (in Ruby, of course), which I hope to
> finish by tomorrow. But it's gotten complicated, which led to try
> introducing Ruby Debug rather than puts debugging statements. For
> this purpose, I was guided by Ruby Cookbook, O'Reilly, 2006.
>
> I thought the RoR community might be sympathetic to a poor soul trying
> to build a Rails-app administration tool.
>

It might. But your proximate problem is not with Rails.

> Best wishes,
> Richard

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

Ruby on Rails

Geez, Marnen,

I don't see why people on a list focused on the most famous Ruby app
would view it beneath themselves to address a fundamental Ruby
question.

Incidentally, my question is, in fact, related to a Rails - a Rails
application. My client for the Rails app wants to change a bunch of
the app's field names. This is a job for a machine, say
ActiveScaffold, for example. However, despite the documentation from
ActiveScaffold.com and folks in the ActiveScaffold newsgroup, I still
don't have that running.

Hence, I wrote my own tool (in Ruby, of course), which I hope to
finish by tomorrow. But it's gotten complicated, which led to try
introducing Ruby Debug rather than puts debugging statements. For
this purpose, I was guided by Ruby Cookbook, O'Reilly, 2006.

I thought the RoR community might be sympathetic to a poor soul trying
to build a Rails-app administration tool.

Best wishes,
Richard

On May 31, 1:39 pm, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
> RichardOnRails wrote:
> > Hi,
>
> > I've got a 7-liner:
> > require 'rubygems'
> > require 'breakpoint'
>
> > a = 'aaa'
> > b = 'bbb'
> > breakpoint
> > c = 'ccc'
>
> > In a Command window, I've got:
> > K:\_Projects\Ruby\_Ruby_Tests\TestBreakpoint>ruby TestBreakpoint.rb
> > Executing break point at TestBreakpoint.rb:9
> > irb(main):001:0> local_variables
> > => ["id", "block", "_"]
> > irb(main):002:0> quit
>
> > Why doesn't the array allegedly presenting local variables:
> > 1. Include a, b & c?
> > 2. Present the things it does; what do they signify?
>
> I don't know, but you're asking this question on the wrong list.  This
> is not a Rails question, and so should be directed to the main Ruby
> list.
>
>
>
> > I'm running Ruby 1.8.6 over WinXP-Pro/SP3
>
> > Thanks in Advance
> > Richard
>
> 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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Ned Pearson wrote:
> I started with the ckeditor rails demo and everything worked
> beautifully.
>
> Then I deployed a couple of sites using a heavily customized "Easy"
> toolbar and everything works great. In these instances I completely
> disable any file upload or management capability.
>
> Next, I implemented the "Full" version for another project so that I
> could have the full functionality of the image uploads, etc. I
> installed the paperclip bundle, manually created my assets/pictures
> folder and manually copied the assets table from the demo app.
>
> Everything works beautifully in the upload department. But when you
> click "Browse Server" it throws an application routing error.
>
> var upload_path = "<%=
> new_attachment_path_with_session_information(:image) %>"
>
> which is in the images.html.erb
>
> After a couple of hours of unsuccessfully trying to correct the
> configuration, and then attempting to disable the button altogether, I
> resorted to crude hackery and simply overwrote all of my ckeditor
> folders with the perfectly functioning folders from the demo version.
>
> I still got the same error. So I tried creating a symlink but that did
> not help either. I also check my yaml file and it is exactly the same as
> in the demo.
>
> Can anyone help? I would be happy if I could just hide the Browse
> Server button. I obviously can't go into production with this mess.

Solved my own problem.

After you create the assets table, and the assets/pictures directory you
have to copy three .rb files from "examples/attachment_fu" into your
application's app/models folder.

Once you've done that and bumped your server, the file browser and full
asset managment capability works.

Perhaps, this post will contribute to needed documentation for others
rails users using ckeditor.

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Greg Ma wrote:
> Hi,
> I am developping a little chat application with rails. On my chat page I
> make ajax request every 10 seconds to check if there are news messages.
> I think if I keep this thing with a lot of user my performance will get
> really low.
>

It shouldn't if you structure your queries efficiently

> How can I improve this? Is is possible to observe when a row is added?

Perhaps, but pushing to the browser is difficult or impossible.

> Or how can I effeciently cache the messages?
>
> Thanks,
> Greg

You're doing premature optimization. Worry about the bottlenecks when
you can actually measure them, not when you're just speculating.

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

Ruby on Rails

no scheduler solution:

why not use created_at or updated_at?
simply get current date than compute days since your prefered event and make it half...



On Sun, May 30, 2010 at 6:26 PM, Becky Russoniello <lists@ruby-forum.com> wrote:
Wow!  Perfect.  Thank you so much.


Sharagoz wrote:
> I would use a scheduler for this kind of stuff. A pure ruby solution
> is rufus scheduler:
> http://github.com/jmettraux/rufus-scheduler
> With rufus scheduler you can schedule a routine that runs every day at
> a given hour and decrements every persons points by 0.5.

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

You might have a look at node.js - I've heard recently of apps which combine node.js w/ redis pubsub to get a pretty nifty quick experience w/ no polling.  From a scalability and performance point of view, this has a couple of drawbacks - susceptible to network latencies, quality (may be better suited for intranet), and second, each client may need it's own port (this for node.js).  



cheers,


m


On Mon, May 31, 2010 at 10:46 AM, Greg Ma <lists@ruby-forum.com> wrote:
Hi,
I am developping a little chat application with rails. On my chat page I
make ajax request every 10 seconds to check if there are news messages.
I think if I keep this thing with a lot of user my performance will get
really low.

How can I improve this? Is is possible to observe when a row is added?
Or how can I effeciently cache the messages?

Thanks,
Greg
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi,
I am developping a little chat application with rails. On my chat page I
make ajax request every 10 seconds to check if there are news messages.
I think if I keep this thing with a lot of user my performance will get
really low.

How can I improve this? Is is possible to observe when a row is added?
Or how can I effeciently cache the messages?

Thanks,
Greg
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

RichardOnRails wrote:
> Hi,
>
> I've got a 7-liner:
> require 'rubygems'
> require 'breakpoint'
>
> a = 'aaa'
> b = 'bbb'
> breakpoint
> c = 'ccc'
>
> In a Command window, I've got:
> K:\_Projects\Ruby\_Ruby_Tests\TestBreakpoint>ruby TestBreakpoint.rb
> Executing break point at TestBreakpoint.rb:9
> irb(main):001:0> local_variables
> => ["id", "block", "_"]
> irb(main):002:0> quit
>
> Why doesn't the array allegedly presenting local variables:
> 1. Include a, b & c?
> 2. Present the things it does; what do they signify?

I don't know, but you're asking this question on the wrong list. This
is not a Rails question, and so should be directed to the main Ruby
list.

>
> I'm running Ruby 1.8.6 over WinXP-Pro/SP3
>
> Thanks in Advance
> Richard

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

Ruby on Rails

Adam Ms. wrote:
> Hello,
>
> What is the 2010 way to get my non-rails gems frozen into my app?

rake gems:unpack , for Rails 2.x. Rails 3 uses Bundler.

>
> TIA!
> a.

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

Ruby on Rails

Agile Web Development with Rails, Edition 4
http://intertwingly.net/projects/AWDwR4/checkdepot/index.html

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hassan Schroeder wrote:
> On Mon, May 31, 2010 at 7:16 AM, Hemant Bhargava <lists@ruby-forum.com>
> wrote:
>
>>>> Basically, if i open an txt file in firefox using "File > Open file"
>>>> then file is opening perfectly. But if i try to open a txt file from a
>>>> file link on a webpage "file:///path" it is not going anywhere?
>
>> By this i mean that page is neither reloading nor going to a new tab.
>> Usually if you click on a link something happens from these two. But now
>> its not.
>
> Dunno if it's a bug or a feature, but yeah, file URLs don't seem to work
> in FF (or Safari, for that matter). But if the link is hand-crafted
> (which is
> what I tried), I don't see how it could be related to Rails, in any
> case.

I have a dim memory that this is a feature, designed to prevent remote
websites from tricking you into editing local files or reading them with
JavaScript. But I could be wrong.

>
> FWIW,
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> twitter: @hassan

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

Ruby on Rails

Hello,

What is the 2010 way to get my non-rails gems frozen into my app?

TIA!
a.
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Bump?! Please, can anyone help?

On 30 May, 09:16, Joe <j...@dev-hq.co.uk> wrote:
> Hi,
>
> Basically I recently been playing around with my ruby on rails system,
> and I'm wondering how I can get it to pick some words from the :name
> of the tutorial (I have a system with categories and tutorials) and
> make this into what I call a tagged domain, basically instead of it
> showing the ID in the URL, it would instead show something like so:
> keyword-keyword-keyword-keyword-keyword
>
> Is this possible? If it is then how would I go about doing it?
>
> Also if I could change the categories URL so instead of categories/ID
> it could be categories/UrlName (a property which I would make); I
> assume this second task would be considerably easier than the first as
> it seems RoR being a clever language would make it easy to do this
> through routes.rb (or something, I'm really still not sure how I can
> change the URL properly)..
>
> This is the main bit of my routes.rb that makes the tutorials and
> categories be displayed in the URL the way they are:
>
>   map.connect 'categories/:id/tutorials/:action', :controller =>
> 'categories'
>
>   map.connect ':controller/:action:id'
>   map.connect ':controller/:action/:id.:format'
>
> map.resources :tutorials,
>   :controller => "categories",
>   :path_prefix => "/category/:category_id",
>   :name_prefix => "category_"
>
> end
>
> Please Help,
>
> I'm sorry for my lack of knowledge,
>
> -Joe

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi again,

Here's a Scrum management tool at version 0.9:
http://sourceforge.net/projects/windsofscrum/
It's based on Henrik Kniberg's book "Scrum and XP from the Trenches"
available at InfoQ.
Maybe you can collect requirements/analyze/design new cool features.
Take a look at it and contact me, you will find installation
instruction in the README file.

Regards


2010/5/31 Pepe Sanchez <lists@ruby-forum.com>:
> Sure!!
>
> Sure!!!
>
>
>
> tramuntanal wrote:
>> Hi Pepe,
>>
>> Do you want to collaborate with open source projects?
>>
>> Regards
>>
>> 2010/5/31 Pepe Sanchez <lists@ruby-forum.com>:
>>> To post to this group, send email to rubyonrails-talk@googlegroups.com.
>>> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
>>> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>>>
>>>
>>
>>
>>
>> --
>> ------------------------------------
>> Oliver Hern�ndez Valls
>>
>> http://codit.wikidot.com
>> http://wiki.tramuntanal.cat
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

--
------------------------------------
Oliver Hernàndez Valls

http://codit.wikidot.com
http://wiki.tramuntanal.cat

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Sure!!

Sure!!!

tramuntanal wrote:
> Hi Pepe,
>
> Do you want to collaborate with open source projects?
>
> Regards
>
> 2010/5/31 Pepe Sanchez <lists@ruby-forum.com>:
>> To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>
>
>
> --
> ------------------------------------
> Oliver Hern�ndez Valls
>
> http://codit.wikidot.com
> http://wiki.tramuntanal.cat
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I started with the ckeditor rails demo and everything worked
beautifully.

Then I deployed a couple of sites using a heavily customized "Easy"
toolbar and everything works great. In these instances I completely
disable any file upload or management capability.

Next, I implemented the "Full" version for another project so that I
could have the full functionality of the image uploads, etc. I
installed the paperclip bundle, manually created my assets/pictures
folder and manually copied the assets table from the demo app.

Everything works beautifully in the upload department. But when you
click "Browse Server" it throws an application routing error.

var upload_path = "<%=
new_attachment_path_with_session_information(:image) %>"

which is in the images.html.erb

After a couple of hours of unsuccessfully trying to correct the
configuration, and then attempting to disable the button altogether, I
resorted to crude hackery and simply overwrote all of my ckeditor
folders with the perfectly functioning folders from the demo version.

I still got the same error. So I tried creating a symlink but that did
not help either. I also check my yaml file and it is exactly the same as
in the demo.

Can anyone help? I would be happy if I could just hide the Browse
Server button. I obviously can't go into production with this mess.
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On May 31, 11:50 am, ms <m...@tzi.de> wrote:
> Hi,
>
> thank you for reading my post. When I went trough my logs last time, I
> noticed that ActiveRecord calls the validate() method of one of my
> models multiple times. The concerned model acts like a linked list (no
> plug-in) and references itself. The validate() method is not only
> called twice, but three or four times depending on the position of the
> model instance in the list.
>
> What's the reason for this and how can I get rid of this?

What does your code look like?

Fred
>
> Thank you very much in advance,
> ms

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Mon, May 31, 2010 at 7:16 AM, Hemant Bhargava <lists@ruby-forum.com> wrote:

>>> Basically, if i open an txt file in firefox using "File > Open file"
>>> then file is opening perfectly. But if i try to open a txt file from a
>>> file link on a webpage "file:///path" it is not going anywhere?

> By this i mean that page is neither reloading nor going to a new tab.
> Usually if you click on a link something happens from these two. But now
> its not.

Dunno if it's a bug or a feature, but yeah, file URLs don't seem to work
in FF (or Safari, for that matter). But if the link is hand-crafted (which is
what I tried), I don't see how it could be related to Rails, in any case.

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

Ruby on Rails

Hi Pepe,

Do you want to collaborate with open source projects?

Regards

2010/5/31 Pepe Sanchez <lists@ruby-forum.com>:
> Hi all
>
> I am currently looking for any ROR sample applciation used for training.
> I am in the processes of collecting requirements/analyzing/designing a
> web site that will provide training
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

--
------------------------------------
Oliver Hernàndez Valls

http://codit.wikidot.com
http://wiki.tramuntanal.cat

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I seem to be getting 2 errors,
Attachment_fu properties are not set
S3 is complaining ( Im not using it)

S3:
Processing ApplicationController#index (for 127.0.0.1 at 2010-05-31
16:49:10) [GET]

NameError (undefined local variable or method `attachment_options' for
#<Class:0x105870a40>):
searchlogic (2.4.11) lib/searchlogic/named_scopes/conditions.rb:
88:in `method_missing'
searchlogic (2.4.11) lib/searchlogic/named_scopes/
association_conditions.rb:19:in `method_missing'
searchlogic (2.4.11) lib/searchlogic/named_scopes/
association_ordering.rb:27:in `method_missing'
searchlogic (2.4.11) lib/searchlogic/named_scopes/ordering.rb:30:in
`method_missing'
searchlogic (2.4.11) lib/searchlogic/named_scopes/or_conditions.rb:
28:in `method_missing'
app/models/photo.rb:15
/Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:
206:in `const_missing'
app/controllers/taggable_sweeper.rb:2
/Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:
206:in `const_missing'
app/controllers/users_controller.rb:5
/Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:
206:in `const_missing'
lib/flash_session_cookie_middleware.rb:14:in `call'
haml (3.0.4) rails/./lib/sass/plugin/rack.rb:41:in `call'
-e:1:in `load'
-e:1

Rendered rescues/_trace (50.5ms)
Rendered rescues/_request_and_response (1.1ms)
Rendering rescues/layout (internal_server_error)

Attachment_FU error:

Mon May 31 16:51:21 +0200 2010: Read error: #<NameError: undefined
local variable or method `attachment_options' for #<Class:
0x105c0c780>>
/Library/Ruby/Gems/1.8/gems/searchlogic-2.4.11/lib/searchlogic/
named_scopes/conditions.rb:88:in `method_missing'
/Library/Ruby/Gems/1.8/gems/searchlogic-2.4.11/lib/searchlogic/
named_scopes/association_conditions.rb:19:in `method_missing'
/Library/Ruby/Gems/1.8/gems/searchlogic-2.4.11/lib/searchlogic/
named_scopes/association_ordering.rb:27:in `method_missing'
/Library/Ruby/Gems/1.8/gems/searchlogic-2.4.11/lib/searchlogic/
named_scopes/ordering.rb:30:in `method_missing'
/Library/Ruby/Gems/1.8/gems/searchlogic-2.4.11/lib/searchlogic/
named_scopes/or_conditions.rb:28:in `method_missing'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
base.rb:1959:in `method_missing'
/Users/pascal/Desktop/Actus/apache2/rubydocs/portal/app/models/
photo.rb:15
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:380:in `load_without_new_constant_marking'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:380:in `load_file'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:379:in `load_file'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:259:in `require_or_load'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:425:in `load_missing_constant'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:80:in `const_missing_not_from_s3_library'
/Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:
206:in `const_missing'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:92:in `const_missing'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:98:in `send'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:98:in `const_missing'
/Users/pascal/Desktop/Actus/apache2/rubydocs/portal/app/controllers/
taggable_sweeper.rb:2
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:380:in `load_without_new_constant_marking'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:380:in `load_file'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:379:in `load_file'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:259:in `require_or_load'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:425:in `load_missing_constant'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:80:in `const_missing_not_from_s3_library'
/Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:
206:in `const_missing'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:92:in `const_missing'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
inflector.rb:361:in `constantize'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
inflector.rb:360:in `each'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
inflector.rb:360:in `constantize'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
core_ext/string/inflections.rb:162:in `constantize'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
observer.rb:38:in `instantiate_observers'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
observer.rb:36:in `each'
/Library/Ruby/Gems/1.8/gems/activerecord-2.3.5/lib/active_record/
observer.rb:36:in `instantiate_observers'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:15:in `define_dispatcher_callbacks'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
callbacks.rb:182:in `call'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
callbacks.rb:182:in `evaluate_method'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
callbacks.rb:166:in `call'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
callbacks.rb:90:in `run'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
callbacks.rb:90:in `each'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
callbacks.rb:90:in `send'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
callbacks.rb:90:in `run'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/active_support/
callbacks.rb:276:in `run_callbacks'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:51:in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:51:in `run_prepare_callbacks'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:56:in `reload_application'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
reloader.rb:33:in `run'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:108:in `call'
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in
`call'
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:
17:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:
13:in `call'
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:in
`call'
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:
64:in `process'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:
34:in `run'
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/pascal/Desktop/Actus/apache2/rubydocs/portal/script/server:3
-e:1:in `load'
-e:1


Anyone has an working example for an attachment_fu initializer which
gets it settings from application.yml?
I have like this code which is not correct:

def prepare_options_for_attachment_fu(options)
attachment_fu_options = options.symbolize_keys.merge(
{:storage => options['storage'].to_sym,
:max_size => options['max_size'].to_i.megabytes,
:processor => (options['processor'] &&
options['processor'].to_sym)
})
end

Searched google for some tutorial with examples already, how can I
hook this code, modified so it works into my app so the attachment_fu
options are set?

Please help im so stuck on this, kind regards

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi all

I am currently looking for any ROR sample applciation used for training.
I am in the processes of collecting requirements/analyzing/designing a
web site that will provide training
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I am struggling with time zone support in Rails 3 beta and I would
like to know if it is a bug or if I am doing something wrong. He is
the problem:

> Time.zone = 'Madrid' # it is GMT+2
=> "Madrid"
> c = Comment.new
=> #<Comment id: nil, title: "", pub_at: nil>
> c.pub_at = Time.zone.parse('10:00:00')
=> Mon, 31 May 2010 10:00:00 CEST +02:00
> c.save
> c
=> #&lt;Comment id: 3, title: "", pub_at: "2010-05-31 08:00:00">
> c.reload
=> #&lt;Comment id: 3, title: "", pub_at: "2010-05-31 08:00:00">
ruby-1.8.7-p249 > c.pub_at
=> Mon, 31 May 2010 13:00:00 CEST +02:00

As you can see, the pub_at attribute is stored correctly in the
database but when it is retrieved it adds 3 hours and I suspect that
it is because it is using my local machine timezone that is in GMT-3.

The same sequence of commands in rails 2.3.5 works perfectly.

Any toughts? Should I report a ticket?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I'm lost. What does this have to do with rails? Sounds like a browser
problem. :-/

Larry

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hassan Schroeder wrote:
> On Mon, May 31, 2010 at 6:07 AM, Hemant Bhargava <lists@ruby-forum.com>
> wrote:
>> Basically, if i open an txt file in firefox using "File > Open file"
>> then file is opening perfectly. But if i try to open a txt file from a
>> file link on a webpage "file:///path" it is not going anywhere?
>
> ? What *exactly* do you mean by "not going anywhere"?

By this i mean that page is neither reloading nor going to a new tab.
Usually if you click on a link something happens from these two. But now
its not.

>
> Does the file url exactly match a path and file on your system?

Yeah path is exactly the same.

>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> twitter: @hassan

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Mon, May 31, 2010 at 6:07 AM, Hemant Bhargava <lists@ruby-forum.com> wrote:
> Basically, if i open an txt file in firefox using "File > Open file"
> then file is opening perfectly. But if i try to open a txt file from a
> file link on a webpage "file:///path" it is not going anywhere?

? What *exactly* do you mean by "not going anywhere"?

Does the file url exactly match a path and file on your system?

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

Ruby on Rails

Hi,

I've got a 7-liner:
require 'rubygems'
require 'breakpoint'

a = 'aaa'
b = 'bbb'
breakpoint
c = 'ccc'

In a Command window, I've got:
K:\_Projects\Ruby\_Ruby_Tests\TestBreakpoint>ruby TestBreakpoint.rb
Executing break point at TestBreakpoint.rb:9
irb(main):001:0> local_variables
=> ["id", "block", "_"]
irb(main):002:0> quit

Why doesn't the array allegedly presenting local variables:
1. Include a, b & c?
2. Present the things it does; what do they signify?

I'm running Ruby 1.8.6 over WinXP-Pro/SP3

Thanks in Advance
Richard

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Basically, if i open an txt file in firefox using "File > Open file"
then file is opening perfectly. But if i try to open a txt file from a
file link on a webpage "file:///path" it is not going anywhere?

Can i fix that in ROR ? If i can, then what is the way to get rid of
this ?
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I'm a recent convert to Rails and I'm working on a new project using Rails 2.3 (I'll probably upgrade at some point when Rails 3 is in production and had a chance to bake the .0 bugs out). I'm going to use Redis anyway for caching important data, so I thought I'd use the redis-store:

http://github.com/jodosha/redis-store

But it appears the flash messages aren't going away when they're supposed to as discussed in this issue, which I haven't gotten a response on yet:

http://github.com/jodosha/redis-store/issues#issue/3

The gist is ActionController::Flash::FlashHash#sweep isn't properly detecting that a flash has been used when using either the Memcache or Redis store for sessions.

So how do I delete them manually? I thought about just editing the FlashHash class and forcing it to delete any flash keys without checking the @used stuff. That would for sure delete the key, but I don't know enough about Rails internals to say whether that will have unintended side effects.

Any advice on what I need to do here?

Thanks!

J. Brisbin
http://jbrisbin.com/

Ruby on Rails

Hi Guys

I am starting a new thread as it seems my gripe isnt to do with
Juggernaut but with TCPSocket - which is used by Juggernaut.

Turns out that the thing that actually hangs up in Juggernaut after x
(130/1500/16000) iterations of

(1..1000).each {|i| Juggernaut.show_clients}

Is actually the line

res << @socket.readline(CR) if response

in juggernaut.rb.

Seems @socket.readline behaves nicely when there is something to read,
but fails miserably with a hangup when there isnt. Even a socket to my
pop mailserver fails:

@socket = TCPSocket.new (mailserver,110)
@socket.readline >> "+OK\r\n"
@socket.readline >> hang

Maybe I am grasping at straws here - for a full description of my
problem with Juggernaut on Windows see

http://www.ruby-forum.com/topic/210450#new

Any ideas would be appreciated!

Pieter Hugo
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi,

thank you for reading my post. When I went trough my logs last time, I
noticed that ActiveRecord calls the validate() method of one of my
models multiple times. The concerned model acts like a linked list (no
plug-in) and references itself. The validate() method is not only
called twice, but three or four times depending on the position of the
model instance in the list.

What's the reason for this and how can I get rid of this?

Thank you very much in advance,
ms

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Frederick Cheung wrote:
> On May 31, 8:49�am, "David B." <li...@ruby-forum.com> wrote:
>
> Call one of the relationships something else, eg
> has_many :something_articles, :class_name => "Article"
>
> Fred

Thank you Fred
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 31 May 2010 07:16, tonypm <tonypmartin@hotmail.com> wrote:
> I often wonder how many other useful little goodies I may be missing.

The have a page through the API docs... it's all in there!

There's interesting stuff in both the Ruby [1] and Rails [2] APIs.
You'll learn loads from looking through both resources' methods for
String, Integer, Array, Enumerable; and in Rails, the
ActionView::Helpers are great eye openers.


[1] http://ruby-doc.org/ - look at the "core api" link for your version
[2] http://api.rubyonrails.org/

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On May 31, 8:49 am, "David B." <li...@ruby-forum.com> wrote:
> Hi,
>

> But this is tricky because of: current_user.articles ...this can return
> articles thanks to *has_many* and *has_and_belongs_to* relations.  So
> there's a collision.
>
> How can I ask articles thanks has_and_belongs_to explicitly.  And thanks
> has_many only too?
>

Call one of the relationships something else, eg
has_many :something_articles, :class_name => "Article"

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

Ruby on Rails

On May 31, 6:25 am, Bob Smith <bsm...@gmail.com> wrote:
> I have a list of people I am using as the collection for a
> render :partial. This is for a list of users that is being made into a
> pdf. I need to do 3 find calls to find out their attendance for the
> last 3 years. The only way I can find to do this is to have the print
> function call its view and have the find code in there, but I know
> that's wrong.. Please point me in the right direction. Maybe a way to
> put the login in the controller ?? Is there a way to add some logic to
> the beginning of a render ??


I think you want to restructure your code a bit. For example, create
an instance method on household for retrieving a view object given a
year. Assuming you had a helper function or a partial for displaying
views your partial for displaying a household wouldn't need to be much
more complicated than

<%= format_view household.view_for_year @year %>

<%= format_view household.view_for_year @year - 1%>

<%= format_view household.view_for_year @year - 2%>


fred
>
>   def print
>     debugger
>     @today = Date.today
>     @year = @today.year
>     @households = Household.find(:all, :order => "last_name,
> first_name")
>     @churches = Church.find(:all, :order => "name").map {|u| [u.name,
> u.id]}
>
>     respond_to do |format|
>      # format.html # index.html
>     #  format.xml { head :ok }
>    #   format.pdf { send_data render_to_pdf({ :action =>
> 'log', :layout => 'pdf_report' }) }
>        format.pdf { send_data render_to_pdf(  :action => 'print',
>                                               :layout =>
> 'pdf_report'),
>                                               :filename => "households
> for " + Time.now.to_s(:long) + ".pdf" }
>     end
>   end
>
>     <% @households.each do |@household| %>
>         <%  @thisyear =
> Visit.find_or_create_by_household_id_and_year(:household_id =>
> @household, :year => @year) %>
>         <%  @lastyear =
> Visit.find_or_create_by_household_id_and_year(:household_id =>
> @household, :year => @year-1) %>
>         <%  @twoyearsago =
> Visit.find_or_create_by_household_id_and_year(:household_id =>
> @household, :year => @year-2) %>
>         <%= render :partial=>"print" %>
>     <% 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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Put this in the model:

HUMAN_ATTRIBUTES = {:some_column => 'Column display
name', :some_other_column => 'Another column display name'}
def self.human_attribute_name(attr)
HUMAN_ATTRIBUTES[attr.to_sym] || super
end

Obviously you want to replace my examples (:some_column, 'Column
display name', etc.) with your column names and display versions of
those names.


On May 29, 10:16 pm, Greg Ma <li...@ruby-forum.com> wrote:
> Hi,
> When an error is display, it first show the column concerned. Does
> someone knows how to change the display column name?
>
> Greg
> --
> 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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Sun, May 30, 2010 at 10:42 PM, dave4c03@greatchiro.com <dave.hurrell@gmail.com> wrote:

Does Rails 3.0.0 beta3 work with ruby 1.9.1 on Windows XP?

It does not work for me, the sample program crashes with no error
message.


Dave, the recommended Ruby version for Rails 3.0 Beta 3 is Ruby 1.9.2 because there seem to
be issues with Ruby 1.9.1.  Please read the following for further details:


Good luck,

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

Ruby on Rails

Hi,

I ve got a question concerning delete actions in the new rails 3 world
with unobtrusive javascript.

How may I perform an "ajax" delete in a list of products.

if attribute data-method is specified rails.js handleMethod is
called,
which adds csrf params into a hidden form and form.submit is called.
Works great, but form.submit is nt performed as an ajax request.

Using data-remote instead of data-method would nt add csrf params.

What s the best approach to achieve what I need?

Thanks a lot in advance.

--
Volker

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi,

I have 2 models: User and Article.

I have this relationship:

* User has many articles (and Article belongs to user)
* User has and belongs to many articles (and Article habtm users)

But this is tricky because of: current_user.articles ...this can return
articles thanks to *has_many* and *has_and_belongs_to* relations. So
there's a collision.

How can I ask articles thanks has_and_belongs_to explicitly. And thanks
has_many only too?

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

Ruby on Rails

So it would seem that there is huge level of subtly in how these path helpers behave based on how your pluralize the helper.  So, what I should have written (and what now appears to work) was:


<%= form_for @thread, :as => :thread, :url => thread_message_path(@thread, @message) do |f| %>

So that's thread_message_path, not thread_messages_path.

However, despite trying other options, it seems I still have to specify the HTTP verb as part of the 'new' case:

<%= form_for @thread, :as => :thread, :url => thread_messages_path(@thread), :html => {:method => :post} do |f| %>

Failing to specify :post results in the form thinking it should be PUTing instead of POSTing:

<form action="/threads/1/messages" class="thread_edit" id="thread_edit" method="post"><div style="margin:0;padding:0;display:inline"><input name="_method" type="hidden" value="put" />

-Mike

On May 30, 2010, at 8:05 PM, Michael Jurewitz wrote:

Hi there,

I can't seem to get form_for to work correctly with the URL I'm providing for a set of nested resources.  Here's what I'm doing in routes.rb:

  resources :threads do
    resources :messages
  end

And then I've got the following form that I'm building as part of /threads/1/messages/1/edit.  Both @thread and @message are set by the controller

....
<%= form_for @thread, :as => :thread, :url => thread_messages_path(@thread, @message) do |f| %>
<%= fields_for :message do |m| %>
.....
<% end %>
<%= submit_tag "Update Message" %>
<% end %>

This is producing the following HTML:

<form action="/threads/1/messages.1" class="thread_edit" id="thread_edit" method="post"><div style="margin:0;padding:0;display:inline"><input name="_method" type="hidden" value="put" />

Notice that while the HTTP method is correctly PUT, the form action ends in .1 instead of /1, which is confusing the router.


Curiously, the 'new' case seems to be getting properly constructed, though I had to manually specify the :method to properly generate the URL:

<%= form_for @thread, :as => :thread, :url => thread_messages_path, :html => {:method => :post} do |f| %>
<%= fields_for :message do |m| %>
...
<% end %>
<%= submit_tag "Create Reply" %>
<% end %>


Am I doing something obviously wrong or is this a deficiency in the path convenience methods?  Note that I am using ":as =>" all over the place because the name of my model object (which is actually "Axthread") does not cleanly map to a named route, and using "thread" as a model name is not an option.

-Mike