I am looking for a ruby hosting service. Can any one recommend one for me.
-----Original Message-----
From: rails-request@lists.rubyonrails.org
[mailto:rails-request@lists.rubyonrails.org]
Sent: Saturday, May 06, 2006 7:37 AM
To: rails@lists.rubyonrails.org
Subject: Rails Digest, Vol 20, Issue 156
Send Rails mailing list submissions to
rails@lists.rubyonrails.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.rubyonrails.org/mailman/listinfo/rails
or, via email, send a message with subject or body ''help'' to
rails-request@lists.rubyonrails.org
You can reach the person managing the list at
rails-owner@lists.rubyonrails.org
When replying, please edit your Subject line so it is more specific than
"Re: Contents of Rails digest..."
Today''s Topics:
1. Re: Rails MySQL Stored Procedure Fun (Paulie)
2. define the meaning of this error (bash)
3. Re: Re: Help: wrong number of arguments (0 for 1)
(Jon Gretar Borgthorsson)
4. Re: ''NameError: uninitialized constant <MyEntity>''
in consol
(Binil Thomas)
5. Pagination Question (Binil Thomas)
6. Re: rake doc:rails fails (Dave Thomas)
7. Re: posting xml in functional test (justin worrall)
8. depot test-driven development exercise (cremes.devlist@mac.com)
9. Re: pdf/writer: table.render_on best practices? (Nicolas Buet)
----------------------------------------------------------------------
Message: 1
Date: Sat, 6 May 2006 14:01:23 +0200
From: Paulie <pauliephonic@gmail.com>
Subject: [Rails] Re: Rails MySQL Stored Procedure Fun
To: rails@lists.rubyonrails.org
Message-ID: <866652e92a11ea4f63bdb9499d0ce6f5@ruby-forum.com>
Content-Type: text/plain; charset=utf-8
Jeremy Kemper wrote:> On May 5, 2006, at 6:42 AM, Paulie wrote:
>> other *nix doesn?t help.
> The pure-Ruby MySQL driver likely doesn''t support for the feature
you
> rely on.
>
> $ ./script/console
> Loading development environment.
> >> require ''mysql''
> => true
>
> # Native bindings:
> >> Mysql.client_info
> => "5.0.19"
>
> # Pure-Ruby driver bundled with Rails:
> >> Mysql.client_info
> => "4.0-ruby-0.2.5"
>
> If you consider this feature widely useful, please consider
> contributing a patch to Active Record (http://dev.rubyonrails.org)
>
> Best,
> jeremy_______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
Hi Jeremy, thanks for taking the time to reply.
I have checked the Ubuntu box and it seems that it is using the non-ruby driver,
but it reports its version as 4.0.24. This may be the cause of my problems.
I have libmysqlclient version 12, 14 and 15 installed and it looks like rails is
using an older one, can I safely remove the older libs (I do not need mysql
clients other than for rails access) or can I specify which to use in the
environment somewhere. I''m just concerned that if Rails is using the
older client and I remove it, it may stop working.
As to the patch for using stored procedures from Rails, I''ll tidy up
the change and submit as you suggest.
Thanks and regards,
paulie
--
Posted via http://www.ruby-forum.com/.
------------------------------
Message: 2
Date: Sat, 6 May 2006 14:30:14 +0200
From: bash <coolebaneseboy@hotmail.com>
Subject: [Rails] define the meaning of this error
To: rails@lists.rubyonrails.org
Message-ID: <d67f0f542ae77c937566ae65e351bc53@ruby-forum.com>
Content-Type: text/plain; charset=utf-8
hi,
i just have this error, can anyone tell me what it means and how i can
fix it thanks.
NameError in HomeController#index
uninitialized constant Student
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
This error occured while loading the following files:
student.rb
Request
Parameters: None
Show session dump
---
user: !ruby/object:User
attributes:
id: "13"
password: 2afdef3e1ba036aa45b6a63421a075aabdbdef19
login: alaa_z
flash: !map:ActionController::Flash::FlashHash {}
Response
Headers: {"cookie"=>[],
"Cache-Control"=>"no-cache"}
--
Posted via http://www.ruby-forum.com/.
------------------------------
Message: 3
Date: Sat, 6 May 2006 13:02:56 +0000
From: "Jon Gretar Borgthorsson" <jon.borgthorsson@gmail.com>
Subject: Re: [Rails] Re: Help: wrong number of arguments (0 for 1)
To: rails@lists.rubyonrails.org
Message-ID:
<dbb6450e0605060602k41cea70ax171f5191668ea9b1@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Yeah. Technically this is a feature in Ruby. :) Allowing you to
overwrite everything for if you need something different for this one
thing. Problem is that you just have to remember a whole lot of
things.
On 5/5/06, Donald Brady <dbrady010@mac.com> wrote:> Ahhhhhhhh
>
> Thank you!!
>
> When your new error messages can be so inscrutable.
>
>
> J?n Borg??rsson wrote:
> > You can not have a column called open in your database. The problem is
> > that RoR creates a class with the database with all the columns as
> > method names. And the class inherits ActionRecord. And open is a
> > method that is neccesary for ActionRecord and you basically are trying
> > to overwrite that. So when ActionRecord tries to open a connection to
> > database all the sudden it finds that the open method has been
> > changed.
> >
> > I had the same problem while trying to create a controller with an
> > action called send.
> >
> > So rename your database column "open" into something like
"is_open"
> >
> > A list of Reserved Words is findable here:
> > http://wiki.rubyonrails.com/rails/pages/ReservedWords
> >
> > On 5/4/06, Donald Brady <dbrady010@mac.com> wrote:
> >> class RestaurantController < ApplicationController
> >> Showing
> >> "update#{@scaffold_suffix}") %>
> >>
usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/templates/scaffolds/new.rhtml
> >> 5:
> >> `email` VARCHAR(100) DEFAULT '''',
> >> CHARACTER SET utf8;
> >> http://lists.rubyonrails.org/mailman/listinfo/rails
> >>
> >
> >
> > --
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
--------------
Jon Gretar Borgthorsson
http://www.jongretar.net/
------------------------------
Message: 4
Date: Sat, 6 May 2006 15:18:33 +0200
From: Binil Thomas <binil.thomas.public@gmail.com>
Subject: [Rails] Re: ''NameError: uninitialized constant
<MyEntity>'' in
consol
To: rails@lists.rubyonrails.org
Message-ID: <d876d45f2eb1879eb17761bad72a9b5f@ruby-forum.com>
Content-Type: text/plain; charset=utf-8
Pete Yandell wrote:> How are you starting up the Rails console?
By invoking script/console from the application directory.
--
Posted via http://www.ruby-forum.com/.
------------------------------
Message: 5
Date: Sat, 6 May 2006 15:24:00 +0200
From: Binil Thomas <binil.thomas.public@gmail.com>
Subject: [Rails] Pagination Question
To: rails@lists.rubyonrails.org
Message-ID: <5d1f160eff2b3938c8dff2960c72af3b@ruby-forum.com>
Content-Type: text/plain; charset=utf-8
I am new to Rails and am running into a problem with pagination.
Consider model classes Employee and Department:
class Employee < ActiveRecord::Base
belongs_to :department
end
class Department < ActiveRecord::Base
has_many :employees
end
In my controller, I need to get a list of employees working in a given
department, and I need to paginate this list. Any pointers on how to
acheive this?
def list_employees
department_name = "My Department"
@employees = # ... ??
@employee_pages = # ...??
end
Thanks,
Binil
--
Posted via http://www.ruby-forum.com/.
------------------------------
Message: 6
Date: Sat, 6 May 2006 07:38:58 -0600
From: Dave Thomas <dave@pragprog.com>
Subject: Re: [Rails] rake doc:rails fails
To: rails@lists.rubyonrails.org
Message-ID: <650276EF-2CEB-4559-8D63-C6F7EBEC07B4@pragprog.com>
Content-Type: text/plain; charset="us-ascii"
Skipped content of type multipart/alternative-------------- next part
--------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2156 bytes
Desc: not available
Url :
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060506/a2fd1c91/smime-0001.bin
------------------------------
Message: 7
Date: Sat, 6 May 2006 15:17:21 +0100
From: "justin worrall" <justin.worrall@gmail.com>
Subject: [Rails] Re: posting xml in functional test
To: rails@lists.rubyonrails.org
Message-ID:
<2577a89d0605060717o4455df78k1643f661183905b2@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
> If "an exception is generated" then it would be good to knwo the
details of said exception.
Sorry - here it is
1) Error:
test_create(PersonControllerTest):
NoMethodError: undefined method `symbolize_keys'' for
"<person><name>John</name></persion>":String
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/test_process.rb:99:in
`assign_parameters''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/test_process.rb:358:in
`process''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/test_process.rb:336:in
`post''
test/functional/person _controller_test.rb:21:in `test_person''
> I''m not sure how to fix it but I believe you stuck that xml in the
post
query string, not the post body.
I agree, that looks likely. Can someone tell me how to add data to the
post body, or point me in the direction of the approproate docs ?
thanks.
>* Hello,
*>*
*>* I''m trying to write a functional test for a simple CRUD
controller which
*>* accepts / emits xml in a REST- like fashion. However the following code
*>* won''t work for me - an exception is generated
*>*
*>* def test_create
*>* post :create,
''<person><name>john</name></person>'',
*>*
{''Content-Type''=>''application/xml''}
*>* assert_response 200
*>* end
**> thanks in advance*
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060506/d2d47991/attachment-0001.html
------------------------------
Message: 8
Date: Sat, 6 May 2006 09:20:06 -0500
From: cremes.devlist@mac.com
Subject: [Rails] depot test-driven development exercise
To: rails@lists.rubyonrails.org
Message-ID: <FEA6883F-1D96-4DEA-A52C-90E8C3921CCF@mac.com>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
(I posted this yesterday but within 20 minutes my thread was hijacked
so I''m not sure anyone really saw this.)
I''ve been working my way through the Agile book and just completed
the depot sample application. I learned quite a bit along the way.
On page 171 we are led through the creation of a test (that fails)
for new code. The new code (a search function) is left as an exercise
for the reader. Well, I think I solved it but I''m not sure I did it
the "Rails way" (even though it passes the test).
After much experimentation, here''s what I did:
1. Edit the depot/app/controller/search_controller.rb file:
class SearchController < ApplicationController
def search
@query = String.new(params[:query])
@products = Product.find(:all,
:conditions => "title like
''%#{@query}
%'' OR
description like
''%#{@query}%''")
flash[:notice] = "Found #{@products.size} product(s)."
end
end
2. cp depot/app/views/layout/store.rhtml depot/app/views/layout/
search.rhtml
3. cp depot/app/views/store/index.rhtml depot/app/views/search/
search.rhtml
4. Edit depot/app/views/search/search.rhtml
Add in another set of <div> tags around it so we have <div
class="results"> as the outermost one. It now looks like:
<div class="results">
<% @products.each do |product| %>
<div class="catalogentry">
<img src="<%= product.image_url %>"/>
<h3><%= h product.title %></h3>
<%= product.description %>
<span class="catalogprice"><%=
fmt_dollars(product.price) %></
span>
<%= link_to ''Add to Cart'',
{:action => ''add_to_cart'', :id =>
product },
:class => ''addtocart'' %><br/>
</div>
<div class="separator"> </div>
<% end %>
</div>
<%= link_to "Show my cart", :action => "display_cart"
%>
5. Change the test so it does "assert_template
''search/search''"
instead of "assert_template ''search/results''".
6. There is no step six.
Was there a better or easier way of accomplishing this task?
Also, why did the book want to test "assert_template ''search/
results''"? That seems like an error to me. The default view for a
controller''s method (action) has the same name as the action, right?
Unless you do a "redirect_to :action =>
''results''" in which case the
"assert_response :success" would now fail because we are redirecting
to a page with a different name. This really confused me and caused
me to flail around much longer than necessary to solve this problem.
Or is the test correct and I can have an action named "search"
rendered by a view named "results"?
cr
------------------------------
Message: 9
Date: Sat, 6 May 2006 16:36:36 +0200
From: "Nicolas Buet" <nicolas.buet@gmail.com>
Subject: Re: [rails] pdf/writer: table.render_on best practices?
To: rails@lists.rubyonrails.org
Message-ID:
<633c85aa0605060736v169d4ac9v10fb0f044bf40d4e@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Thanks Jodi, great advice!
On 5/5/06, Jodi Showers <jodi@nnovation.ca> wrote:>
>
> On 5-May-06, at 1:03 PM, Austin Ziegler wrote:
> >
> > Transaction::Simple. Or at least the use thereof.
> >
> > Transaction::Simple does its job well, but I''m not currently
doing a
> > good job of clearing unused data and keeping too much rewind
> > information, I think. Reducing that should bring a performance boost.
> > Figuring out a way to precalculate the size of the data so that rewind
> > doesn''t have to happen would be good, too. It would be
cheaper to
> > simulate to set up pagination points than to recover if we do need to
> > paginate.
> >
> > -austin
>
> Ok. after much rumination and consideration about writing a
> preprocessor it became clearer that the transactions were the
> (slowdown) culprit(duh), and if I''m dealing with a huge number of
> rows then split_rows should NEVER be set to true, as the (rewind)
> rollback condition would never occur, and thus the transaction space
> would fill up - 1 transaction per row.
>
> ...and \me had split_rows set to false (default value).
>
> grin.
>
> after using the correct setting I''m looking at a 1000% speedup.
>
> So the only code improvement I might suggest Austin would be to set
> split_rows to true if render_on detects more rows than can ever be
> fit on one page - or perhaps a private that does the same thing
> without changing the programmers interface.
>
> Nicolas you might check to see if you''ve set split_rows correctly
-
> you''ll get the same pdf output, but transactions won''t be
used to
> hold row state.
>
> cheers,
> Jodi
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060506/771036c1/attachment.html
------------------------------
_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
End of Rails Digest, Vol 20, Issue 156
**************************************