[Rails] Re: Scaffolding

2010-07-03 Thread Andre Cubeta
Hemant Bhargava wrote:
 Sur Max wrote:
 IMHO, you really need to study the routes and how restful routing
 works. http://guides.rubyonrails.org/routing.html
 Scaffolding must have had generated the restful routing for the said
 controller and thus no other method except CRUD is being entertained
 unless specified.
 
 add your method in the file config/routes.rb like this...
 
 Say your controller is posts
 
 map.resources  :posts, :collection = {:abc_whatever = :any}
 
 Ok thanks a lot for your info. I'll read them.
 
 
 
 regards,
 Sur
 http://crimson9.com

Ryan Bates (http://railscasts.com/)  might help you a lot when setting 
collection and member method from your class Controllers to your 
routes.rb file, it will show you some techniques efficiently like 
with_options and such ... (just check it out)

Andre
-- 
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] count the hits on page

2010-07-03 Thread Rajkumar Surabhi
Hi,

I want to count the hits on my web site. how to do this by using ror
application
-- 
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: Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-03 Thread Fernando Perez
 And I saw A LOT about the magic comment, but where do I put it in a
 template? And there's no way to basically set a default magic
 comment?

Same problem for me. I fixed the models, controllers and helpers by 
adding the magic comments, but I don't know how to fix the problem in 
the view. Anyone?
-- 
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] tangent question regarding Ajax best practice

2010-07-03 Thread Doug Boude
In my current project, I'm finding myself really adding meat to my global
ajax responders (the global code that typically is used to indicate that
some ajax activity is taking place). This is really the first time it has
seemed like the right place for me to add a lot of logic, but in doing so it
got me to wondering if I really SHOULD be doing this. Reason being, my
global responder is going to respond globally to ANY ajax activity, and
the logic I'm writing will only apply to SOME of the ajax activity (in this
case, some = most, but not all).

How does it strike you all who use global responders? Is it just a bad road
to go down to add logic that only applies to certain ajax calls in a global
responder?

Thanks for your thoughts.

Doug Boude

-- 
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] Help with some important information about Rails

2010-07-03 Thread Carlos Zambrano
Hello how are all

My name is Carlos Zambrano, I'm from Ecuador and I'm doing a graduate thesis
about Ruby on Rails vs Php on other frameworks such as Zend, Django and
Python on Java or Struts.

I would like you to help me with information about which items should be
taken into consideration to make if compared to these other languages vs
Ruby because my goal is to demonstrate that this tool is much better than
the others.

I've been reading about the language and I've been completely fascinated but
still got a lot more to learn, so if you like me to help me because you are
more experts on this subject.

Sorry if my English is not very good but I try to do everything possible to
make myself understood.

Thanks for your attention

Carlos Zambrano Tandazo
Asistencia Tecnica y Desarrollo de Software
e-mail: carza...@gmail.com
Telefono: 091150706
Blog: http://krloco78.blogspot.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] Help with some important information about Rails

2010-07-03 Thread Carlos Zambrano
Hello how are all

My name is Carlos Zambrano, I'm from Ecuador and I'm doing a graduate thesis
about Ruby on Rails vs Php on other frameworks such as Zend, Django and
Python on Java or Struts.

I would like you to help me with information about which items should be
taken into consideration to make if compared to these other languages vs
Ruby because my goal is to demonstrate that this tool is much better than
the others.

I've been reading about the language and I've been completely fascinated but
still got a lot more to learn, so if you like me to help me because you are
more experts on this subject.

Sorry if my English is not very good but I try to do everything possible to
make myself understood.

Thanks for your attention


Carlos Zambrano Tandazo
Asistencia Tecnica y Desarrollo de Software
e-mail: carza...@gmail.com
Telefono: 091150706
Blog: http://krloco78.blogspot.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] How can I retrieve the object on an association without going through the database?

2010-07-03 Thread Ken


Consider the following setup:

class Parent  ActiveRecord::Base
  has_many :children
end

class Child  ActiveRecord::Base
  belongs_to :parent
end

And this console session:

 p = Parent.find 41
 p.some_attr = 'some_value'
 c = p.children.build
 c.parent

By watching my log files, I can see that c.parent is querying the db
for the parent object. I want instead to access the existing in-memory
object (p), because I need access to the parent's some_attr value,
which is not yet stored in the database. Is there any way of doing
this? c.parent(force_reload=false) doesn't get me there.

-- 
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: Scaffolding

2010-07-03 Thread Mirza Ceric

Yes, you have to create a route for that (see config/routes.rb)
Tutorial: http://guides.rails.info/

Regards,
Mirza

On Jul 2, 8:59 am, Hemant Bhargava li...@ruby-forum.com wrote:
 Hello All,

 I am using scaffolding but i can not figure out that how to write my own
 methods except CRUD. I mean i know how to use CRUD methods but if i
 write my own method in my controller and call that from views then the
 request is going to show method.

 Ok.. the scenario is that have an method abc_whatever in my controller.
 So i call this as ModelName/abc_whatever from the views. Before using
 scaffolding it was going fine but after scaffolding this request is
 going to show method. Is it something to do with routes..?

 Thanks in advance.
 --
 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 at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Rails 3 periodically_call_remote

2010-07-03 Thread Gonzalo Rodríguez-Baltanás Díaz

Hi

¿What is the equivalent to periodically_call_remote in Rails 3?


Thank you


-- 
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] How to change a query objective

2010-07-03 Thread Stefano Verna
Quick question:

 Group.first.resources.joins(:tags).group(tags.id).select(tags.id, 
 count(*))
= [#Resource id: 1, #Resource id: 2, #Resource id: 3,
#Resource id: 4, #Resource id: 5]

This results in the following (correct) query:

SELECT tags.id, count(*) FROM resources INNER JOIN taggings ON
resources.id = taggings.resource_id INNER JOIN tags ON
tags.id = taggings.tag_id INNER JOIN group_resources ON
resources.id = group_resources.resource_id WHERE
((group_resources.group_id = 1)) GROUP BY tags.id

I don't want the Resources, I want the damn Tags. Any clues?

-- 
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] Update multiple fields with onclick

2010-07-03 Thread InventoryTrackers
We've all seen the checkout forms with Bill To: and Ship To: I'd like
to have a button that says Ship to Bill To: and if we click it, it
copies all the Ship To: fields across such as phone, email, etc.
I've been looking at link_to_function, is that the right path?
I've done observe_fields before but that went to a controller action
whereas here we could get by just copying params[field_values].
Thanks,
David

-- 
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: MySQL server has gone away

2010-07-03 Thread j_l_
Did you check mysql config on server?

On Jun 30, 5:12 am, fischer1121 bfischer1...@gmail.com wrote:
 Hi all,

 I am getting the following error in the middle of a long-running
 process: Mysql::Error: Lost connection to MySQL server during
 query:...
 When rescued and retried, it throws the next error: Mysql::Error:
 MySQL server has gone away

 (1) The query is not long and (2) the process does not last longer
 than 8 hours (it's  15 minutes) or idle for a long period.

 I've tried: ActiveRecord::Base.allow_concurrency = true,
 ActiveRecord::Base.verification_timeout = 10, and
 ActiveRecord::Base.verify_active_connections!

 I can use (1) ActiveRecord::Base.connection_pool.with_connection or
 (2) ActiveRecord::Base.verify_active_connections! to fix it, but...

 when future queries search for data that was inserted previously in
 the process, it is no longer there. It seems like there's something
 wrapped around everything - tied to the connection - that prevents any
 writes from really persisting to the database until, I'm assuming, the
 process is complete.

 How do I fix the lost MySQL connections or at least make writes
 persist to the database mid-process so that when I open a new
 connection the records will be there?

 Any help is appreciated.

 Thanks,

 Blake

-- 
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] Reposted from Superuser - Installing Ruby on Rails on Ubuntu 10.04: A Living Nightmare

2010-07-03 Thread emptyset
I'm reposting this here from my original post on Superuser[1], to
hopefully get more relevant feedback from more experienced RoR users.
I need to get a RoR environment up and running, because I have a
client that needs some RoR work done on her website.  Although I'm new
to RoR, I'm a quick learner and was expecting installing and setting
up the environment was easy, so I could focus my effort on site
development.  I've already spent five days trying to get the
environment up so I could just begin working.  I'll probably have
follow up questions to this group (seems I can't get script/server to
work at all) - but for now, this is the immediate concern.

Update #3: Starting over from scratch, shortened this post, decided to
re-install a clean copy of Ubuntu 10.04 on a VM and go through the
walk-through[0] again. So, all the steps go without a hitch. As root:

r...@ubuntu:~/rubygems-1.3.7# ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
r...@ubuntu:~/rubygems-1.3.7# gem -v
1.3.7
r...@ubuntu:~/rubygems-1.3.7# rails -v
Rails 2.3.8
Now, as myself (in a separate term):

empty...@ubuntu:~$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
empty...@ubuntu:~$ gem -v
/usr/local/lib/site_ruby/1.8/rubygems.rb:10:in `require': no such file
to load -- rubygems/defaults (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems.rb:10
from /usr/local/bin/gem:8:in `require'
from /usr/local/bin/gem:8
empty...@ubuntu:~$ rails -v
bash: /usr/bin/rails: Permission denied

So, this appears to be a permissions issue, but I don't understand
why. Specifically, if I have to start making things go+rx all over the
place, I really need to understand which specific files need the
permissions change.

Site references:
[0] 
http://castilho.biz/blog/2010/05/08/how-to-install-ruby-on-rails-on-ubuntu-10-04-lucid-lynx/
[1] 
http://superuser.com/questions/156498/installing-ruby-on-rails-on-ubuntu-10-04-a-living-nightmare

-- 
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] Ruby on Rails - RHEL

2010-07-03 Thread nux
On 01/Jul/2010 11:10 Gabor Antal li...@ruby-forum.com wrote ..
 Hi,
 
 I am fighting to install Redmine therefore I need to install Ruby on
 Rails to a machine behind many firewalls. OS is RHEL.
 
 My idea was to download the packages, make and install...
 
 There was some difficulties because the latest Ruby in the RHEL repo was
 not modern enough for gem. So I donwloaded the source of ruby. Its
 intall was perfect. After that point I managed to install gem.
 
 
 But since this, I have no idea how can I install the rake, rail, etc.
 packages with gem from local files because the firewalls do not allowe
 me public internet connection in this host.
 
 Can you help me?
 
 
 Best Regards,
 
 Gabor
 -- 
 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.
 

I hope you installed ruby on a different path (e.g. /opt/ruby).
Installing newer ruby on rhel/centos is quite trivial tho, check this
out for example:
http://blog.perplexedlabs.com/2009/01/13/installing-ruby-enterprise-edition-with-phusion-passenger/

--
Nux!
www.nux.ro

-- 
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: best way to internationalize content from database

2010-07-03 Thread abstract
Have you considered this http://github.com/joshmh/globalize2 ?

On Jul 1, 10:36 pm, Anderson Leite li...@ruby-forum.com wrote:
 Hello all.

 It's ok to internationalize thing at app using rails, but how to deal
 with content from database ?

 What's the best aproach ? I don't wanna do things like:

 % if english %
    %= obj.name_english%
 % else %
    %= obj.name_japanese%
 % end %

 The best way is to do all at controller ? model ?

 How do you thing is the better approach ?

 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-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] Good Linux Distro for Rails 3?

2010-07-03 Thread Nick Hird
This may be the wrong place for this question but i am not sure where to go.


What is a good linux distro to get started with rails 3? I have given up on
ubuntu and any related distro since the version of gem isnt high enough for
rails and its related packages. I cant seem to use Arch since they use ruby
1.9.1. Is there a distro that has what i need in its package manager so that
i can be up and running fairly quickly? I am not the best at getting all the
packages running from scratch, so i rely on package managers but that seems
to be a loosing battle as well. Any help or recommendations would be
appreciated.

~Nick

-- 
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] Doesn't work erb engine

2010-07-03 Thread Karen Kalashyan
I'm new in RoR:)

I have controller and view (/app/controllers/greeting_controller.rb
and /app/views/greeting/index.rhtml /.erb/.html.erb - doesn't match).

greeting_controller.rb source:

class GreetingController  ApplicationController
def index
@message = Hello world!
end
end


index.rhtml source:

html
headtitletest/title/head
body
p%= @message %/p
/body
/html

and html output is exact copy of index.rhtml

* i'm working on macOS 10.6.4

please help!!))

-- 
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: making something available application wide

2010-07-03 Thread sdwrage
Making it a before_filter makes it so you won't need to call the
method to set your banner every single time. It will be done before
any action is called.

On Jul 2, 12:25 pm, bingo bob li...@ruby-forum.com wrote:
 Aha !

 You could put the @banner_url = BannerAdvert.. in you
 application_controller.rb. Make it a before_filter.

 That's the bit I missed then, I just stuck @banner_url =
 BannerAdvert.first in the application_controller.rb, I need a
 before_filter to call a method in that controller - that right ?
 --
 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 at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Updating Bill To: fields to Ship To:

2010-07-03 Thread InventoryTrackers
You've all seen that shopping carts have a checkbox that automatically
moves the Bill To: fields (such as name, phone number, etc) across to
the Ship To: fields.
How would you approach this in Rails?
Thank you

-- 
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: making something available application wide

2010-07-03 Thread bingo bob

Thanks to all, settled on this code in the end in case useful to anyone 
else - further tips appreciated, works great though.

class ApplicationController  ActionController::Base

  before_filter :grab_banner

  def grab_banner
banner = BannerAdvert.first(:conditions = [ published = ?, 1], 
:order = RAND())
if banner
  @banner_url = banner.url
end
  end

end



I realised lightening bolt, that for many thing I don't actually NEED 
an admin interface/scaffold - like in this case I just created a 
BannerAdvert model and I CRUD the records directly with Sequel Pro. 
Anyone comment on this approach - saves me hours and keeps the app 
clean. Silly, simple tip - no more scaffolded code - except when it 
helps me - feels like coming on to the next stage.. :-).
-- 
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: Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-03 Thread Fernando Perez
Adding to environment.rb:

Encoding.default_external = Encoding::UTF_8

Helps fix a few problems until it explodes somewhere else.

Ruby 1.9 is a catastrophe!
-- 
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: How can I retrieve the object on an association without going through the database?

2010-07-03 Thread Kenneth    
are you using rails 3?

If you are I think you just do

p = Parent.includes(:children).find(41)
-- 
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: Good Linux Distro for Rails 3?

2010-07-03 Thread Kenneth    
Then update your version of gem with gem update command.

I mean if ubuntu isn't gonna work for you, then I doubt anything else 
will. I think ubuntu has the most up to date packages of any distro.
-- 
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: Good Linux Distro for Rails 3?

2010-07-03 Thread Kenneth    
But I very much dislike ubuntu for rails. I tried it before and 
everything just did not work out. Too many files were named weirdly and 
I just did not want to deal with renaming or symlinking.

I stuck with CentOS 5.5 (also works with Fedora 13) and compiled ruby 
1.9.2 from source (preview3, but the RC just came out) and then 
downloaded rubygems 1.3.7 and compiled that as well. I never got RVM to 
work with it though...
-- 
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: invalid multibyte character error

2010-07-03 Thread Fernando Perez

 When I try to use multibyte characters in my rails controller I get an
 invalid multibyte characters error
 (rails_app/app/controllers/admin_controller.rb:6: invalid multibyte
 char (US-ASCII)).
 
 
 After I start the WEBrick server and go to
 http://localhost:3000/admin/read I get the error. However, if I set #
 encoding: utf-8 on top of the controller file the error disappear.
 
 The question is how can I officially correct this error? How can I
 maintain Rails to proper multibyte characters handling?

Is there a solution to this in 2010?
-- 
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] Reposted from Superuser - Installing Ruby on Rails on Ubuntu 10.04: A Living Nightmare

2010-07-03 Thread Filipe Quadros Borges
I installed Ruby and Rails on Ubuntu 10.04 by following this guide:
https://help.ubuntu.com/community/RubyOnRails.
Everything went well.

Quick steps:
 1.  sudo apt-get install ruby-full build-essential
 2. Download and install latest rubygems. Do not use apt-get because
rubygems update itself and corrupts apt-get.
 3.  sudo gem install rails
 4. test your environment!  rails ~/my_test_app


On Wed, Jun 30, 2010 at 2:03 PM, emptyset empty...@gmail.com wrote:
 I'm reposting this here from my original post on Superuser[1], to
 hopefully get more relevant feedback from more experienced RoR users.
 I need to get a RoR environment up and running, because I have a
 client that needs some RoR work done on her website.  Although I'm new
 to RoR, I'm a quick learner and was expecting installing and setting
 up the environment was easy, so I could focus my effort on site
 development.  I've already spent five days trying to get the
 environment up so I could just begin working.  I'll probably have
 follow up questions to this group (seems I can't get script/server to
 work at all) - but for now, this is the immediate concern.

 Update #3: Starting over from scratch, shortened this post, decided to
 re-install a clean copy of Ubuntu 10.04 on a VM and go through the
 walk-through[0] again. So, all the steps go without a hitch. As root:

 r...@ubuntu:~/rubygems-1.3.7# ruby -v
 ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
 r...@ubuntu:~/rubygems-1.3.7# gem -v
 1.3.7
 r...@ubuntu:~/rubygems-1.3.7# rails -v
 Rails 2.3.8
 Now, as myself (in a separate term):

 empty...@ubuntu:~$ ruby -v
 ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
 empty...@ubuntu:~$ gem -v
 /usr/local/lib/site_ruby/1.8/rubygems.rb:10:in `require': no such file
 to load -- rubygems/defaults (LoadError)
    from /usr/local/lib/site_ruby/1.8/rubygems.rb:10
    from /usr/local/bin/gem:8:in `require'
    from /usr/local/bin/gem:8
 empty...@ubuntu:~$ rails -v
 bash: /usr/bin/rails: Permission denied

 So, this appears to be a permissions issue, but I don't understand
 why. Specifically, if I have to start making things go+rx all over the
 place, I really need to understand which specific files need the
 permissions change.

 Site references:
 [0] 
 http://castilho.biz/blog/2010/05/08/how-to-install-ruby-on-rails-on-ubuntu-10-04-lucid-lynx/
 [1] 
 http://superuser.com/questions/156498/installing-ruby-on-rails-on-ubuntu-10-04-a-living-nightmare

 --
 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.





-- 
Filipe Quadros Borges

email: fqbor...@gmail.com
msn: fqbor...@hotmail.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: Good Linux Distro for Rails 3?

2010-07-03 Thread Victor S
Sounds too strange to me...

I think you could just ignore the built in package managers and
download and install your gems, rvm and whatever else from github and
the gem package manager. Forget about ubuntu or fedoras packages...

Victor

On Jul 3, 7:43 am, Kenneth     li...@ruby-forum.com wrote:
 But I very much dislike ubuntu for rails. I tried it before and
 everything just did not work out. Too many files were named weirdly and
 I just did not want to deal with renaming or symlinking.

 I stuck with CentOS 5.5 (also works with Fedora 13) and compiled ruby
 1.9.2 from source (preview3, but the RC just came out) and then
 downloaded rubygems 1.3.7 and compiled that as well. I never got RVM to
 work with it though...
 --
 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 at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Reposted from Superuser - Installing Ruby on Rails on Ubuntu 10.04: A Living Nightmare

2010-07-03 Thread Victor S

I would strongly suggest you look into rvm to manage your ruby/rails
environments. But you might also want to install gem as your own user
as opposed to root. The new gems will be kept somewhere in your home
directory.

- Victor


On Jun 30, 1:03 pm, emptyset empty...@gmail.com wrote:
 I'm reposting this here from my original post on Superuser[1], to
 hopefully get more relevant feedback from more experienced RoR users.
 I need to get a RoR environment up and running, because I have a
 client that needs some RoR work done on her website.  Although I'm new
 to RoR, I'm a quick learner and was expecting installing and setting
 up the environment was easy, so I could focus my effort on site
 development.  I've already spent five days trying to get the
 environment up so I could just begin working.  I'll probably have
 follow up questions to this group (seems I can't get script/server to
 work at all) - but for now, this is the immediate concern.

 Update #3: Starting over from scratch, shortened this post, decided to
 re-install a clean copy of Ubuntu 10.04 on a VM and go through the
 walk-through[0] again. So, all the steps go without a hitch. As root:

 r...@ubuntu:~/rubygems-1.3.7# ruby -v
 ruby1.8.7(2010-01-10 patchlevel 249) [x86_64-linux]
 r...@ubuntu:~/rubygems-1.3.7# gem -v
 1.3.7
 r...@ubuntu:~/rubygems-1.3.7# rails -v
 Rails 2.3.8
 Now, as myself (in a separate term):

 empty...@ubuntu:~$ ruby -v
 ruby1.8.7(2010-01-10 patchlevel 249) [x86_64-linux]
 empty...@ubuntu:~$ gem -v
 /usr/local/lib/site_ruby/1.8/rubygems.rb:10:in `require': no such file
 to load -- rubygems/defaults (LoadError)
     from /usr/local/lib/site_ruby/1.8/rubygems.rb:10
     from /usr/local/bin/gem:8:in `require'
     from /usr/local/bin/gem:8
 empty...@ubuntu:~$ rails -v
 bash: /usr/bin/rails: Permission denied

 So, this appears to be a permissions issue, but I don't understand
 why. Specifically, if I have to start making things go+rx all over the
 place, I really need to understand which specific files need the
 permissions change.

 Site references:
 [0]http://castilho.biz/blog/2010/05/08/how-to-install-ruby-on-rails-on-u...
 [1]http://superuser.com/questions/156498/installing-ruby-on-rails-on-ubu...

-- 
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: Good Linux Distro for Rails 3?

2010-07-03 Thread Marnen Laibow-Koser
Victor Stan wrote:
 Sounds too strange to me...
 
 I think you could just ignore the built in package managers and
 download and install your gems, rvm and whatever else from github and
 the gem package manager. Forget about ubuntu or fedoras packages...

Exactly.  At least for Rails 2.x, Ubuntu works quite well.  You can 
probably get away with installing Ruby through  apt-get; then just 
download RubyGems yourself and use that to install gems.  No problem.

 
 Victor


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

Sent from my iPhone
-- 
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: Reposted from Superuser - Installing Ruby on Rails on Ubuntu 10.04: A Living Nightmare

2010-07-03 Thread Marnen Laibow-Koser
Victor Stan wrote:
 I would strongly suggest you look into rvm to manage your ruby/rails
 environments. But you might also want to install gem as your own user
 as opposed to root. The new gems will be kept somewhere in your home
 directory.

That always seems to cause problems.  I'd rather keep gems available 
system-wide.

 
 - Victor




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

Sent from my iPhone
-- 
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: Update multiple fields with onclick

2010-07-03 Thread Marnen Laibow-Koser
InventoryTrackers wrote:
 We've all seen the checkout forms with Bill To: and Ship To: I'd like
 to have a button that says Ship to Bill To: and if we click it, it
 copies all the Ship To: fields across such as phone, email, etc.
 I've been looking at link_to_function, is that the right path?

Probably.  The JavaScript for this should be very simple to write.  If I 
were you, though, I wouldn't use link_to_function unless you're already 
on Rails 3: Rails 2's JS helpers mix JS into your HTML, where it really 
doesn't belong.

 I've done observe_fields before but that went to a controller action
 whereas here we could get by just copying params[field_values].
 Thanks,
 David

-- 
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: MySQL not Connected ...... *pull hair*

2010-07-03 Thread Victor S

Sure get a Mac ;)

No but seriously first there's no reason why your app should be in the
www folder the only thing you want to expose to the world is he public
folder and you can do that by simlinking I don't know what the
equivalent is on windows well I don't know why anyone does web dev on
a non unix Linux environnment but I've seen weirder things... Also
you'll need phusion passenger to get your ruby working with apache. If
you want a prepackaged server  stack look into  http://bitnami.org/ I
got them working on my win 7 box of failure (does my bias come
through ?) but before you do all that you should know that you don't
need a separate server to develop your ruby rails app. Rails come with
it's own server you can use while developing...

Cheers

Victor


On Jul 2, 11:42 am, Dave Digital li...@ruby-forum.com wrote:
 I'm trying to run  rake db:migrate  and im getting an error back:

 

 C:\wamp\www\demoprojectrake db:migrate
 (in C:/wamp/www/demoproject)
 rake aborted!
 Mysql::Error: query: not connected: CREATE TABLE `schema_migrations`
 (`version`
 varchar(255) NOT NULL) ENGINE=InnoDB

 (See full trace by running task with --trace)

 

 Something is definitely wrong because when I try to run 
 script/dbconsole  i get an error also

 

 C:\wamp\www\demoprojectruby script/dbconsole
 Couldn't find database client: mysql, mysql5. Check your $PATH and try
 again.

 

 I have been fighting to get RoR installed for almost 2 weeks and my
 patience and time is running low. This is as bad as when I first
 installed apache, mysql and php on my system 7 years ago. I would gladly
 pay for an installer that just made everything work!
 --
 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 at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Updating Bill To: fields to Ship To:

2010-07-03 Thread Victor S
By using JavaScript...

On Jul 1, 4:44 pm, InventoryTrackers inventorytrack...@gmail.com
wrote:
 You've all seen that shopping carts have a checkbox that automatically
 moves the Bill To: fields (such as name, phone number, etc) across to
 the Ship To: fields.
 How would you approach this in Rails?
 Thank you

-- 
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: MySQL not Connected ...... *pull hair*

2010-07-03 Thread Victor S
Also as someone mentioned already. You want to keep an eye on the
mysqlserver socket... But if your just working on local to develop
screw mysql use sqlite3 and just use mysql on production... Which
hopefully is not an iis server...

On Jul 2, 11:42 am, Dave Digital li...@ruby-forum.com wrote:
 I'm trying to run  rake db:migrate  and im getting an error back:

 

 C:\wamp\www\demoprojectrake db:migrate
 (in C:/wamp/www/demoproject)
 rake aborted!
 Mysql::Error: query: not connected: CREATE TABLE `schema_migrations`
 (`version`
 varchar(255) NOT NULL) ENGINE=InnoDB

 (See full trace by running task with --trace)

 

 Something is definitely wrong because when I try to run 
 script/dbconsole  i get an error also

 

 C:\wamp\www\demoprojectruby script/dbconsole
 Couldn't find database client: mysql, mysql5. Check your $PATH and try
 again.

 

 I have been fighting to get RoR installed for almost 2 weeks and my
 patience and time is running low. This is as bad as when I first
 installed apache, mysql and php on my system 7 years ago. I would gladly
 pay for an installer that just made everything work!
 --
 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 at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: making something available application wide

2010-07-03 Thread Hassan Schroeder
On Sat, Jul 3, 2010 at 3:30 AM, bingo bob li...@ruby-forum.com wrote:

 Thanks to all, settled on this code in the end in case useful to anyone
 else - further tips appreciated

    banner = BannerAdvert.first(:conditions = [ published = ?, 1],
 :order = RAND())

Even if you're currently only working with a single database, it might
be a good idea to abstract that last statement. Different DBs use a
different syntax, so for example I'd write that as

   :order = RANDOM

where RANDOM is set in an initializer based on the DB actually being
used, e.g. http://pastie.org/1029327

I work in a lot of mixed environments, so that may be more useful to
me than most people, but...

FWIW,
-- 
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: Update multiple fields with onclick

2010-07-03 Thread Me
Probably a whole lot easier if you just have a checkbox indicating if
the ship is the same as the bill_to.  Pretty common to do that less
hassle.

On Jul 3, 9:12 am, Marnen Laibow-Koser li...@ruby-forum.com wrote:
 InventoryTrackers wrote:
  We've all seen the checkout forms with Bill To: and Ship To: I'd like
  to have a button that says Ship to Bill To: and if we click it, it
  copies all the Ship To: fields across such as phone, email, etc.
  I've been looking at link_to_function, is that the right path?

 Probably.  The JavaScript for this should be very simple to write.  If I
 were you, though, I wouldn't use link_to_function unless you're already
 on Rails 3: Rails 2's JS helpers mix JS into your HTML, where it really
 doesn't belong.

  I've done observe_fields before but that went to a controller action
  whereas here we could get by just copying params[field_values].
  Thanks,
  David

 --
 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 at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: url error rails 2.3.5

2010-07-03 Thread Me
Ok, found the issue.  equipment is not pluralized anywhere and the
routes were having issues.  Had to do this:

map.resources :equipment, :singular = :equipment

On Jul 2, 6:54 pm, Me chabg...@gmail.com wrote:
 I have the routes set up for 'equipment', standard scaffold.  When I
 try to go to equipment/new this error pops up:

 Showing app/views/equipment/new.html.erb where line #3 raised:

 equipment_url failed to generate from
 {:action=show, :controller=equipment} - you may have ambiguous
 routes, or you may need to supply additional parameters for this
 route.  content_url has the following required parameters:
 [equipment, :id] - are they all satisfied?

 Not sure why it is trying to go to the show action..

-- 
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: active record question

2010-07-03 Thread Me
If your models are set up correctly you can do '@user.questions'  for
the collection.  You can set up a method or named_scope maybe on the
user model:

def needed_questions
  self.questions.reject{|q| q.nil?}.all
end

something like that.

On Jul 1, 9:37 pm, RailsFan Radha li...@ruby-forum.com wrote:
 You could either use the find_by_sql method or the :joins method. (As
 someone has stated earlier that avoid find_by_sql for performance and
 maintanence reasons)

 sample sql to put in find_by_sql in your model

 select question_id from responses r1
 where not exists
 (select question_id from question q )

 using :joins. (probably this would be better )

 questions.find(  :joins = LEFT OUTER JOIN responses ON question_id =
 responses.question_id  :conditions = responses.id is null)

 gurus, please comment on this.

 thanks,
 radha.

 badnaam wrote:
  I have three models, Question, Response and User

  User has many question, :through Responses

  My response table has 3 main columns response, question_id and
  user_id.

  The use case is lets say the user can respond to 100 question, but
  during a session he responds to 20. How do I find out the ones he has
  not respondeded to. In this case the response table will have 20
  records and I woukd like to show the user the rest of the 80 he has
  not responded to.

  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-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] Renderer: rendering to *another* format inside a renderer

2010-07-03 Thread Michael Schuerig

My skeletal renderer looks like this

  ActionController.add_renderer :pdf do |template, options|
html = render_to_string(template, options)
...
  end

The trouble here is that render_to_string looks for a template for MIME 
type PDF, e.g. show.pdf.erb. Unfortunately, that's not what I want. I 
need to get HTML. I haven't found a straightforward option to achieve 
this.

  html = render_to_string(options.merge(
:template = #{template}.html)

That's not pretty, but gets me halfway there. However, when I call

  render :pdf = 'show', :layout = 'print'

the layout is passed through to render_to_string, but ignored. If I 
rename layouts/print.html.erb to layouts/print.pdf.erb, it works as long 
as all partials used by that layout are available in pdf variants, too.

Now, I see that this behavior might be useful most of the time, but this 
time it is exactly not what I want. Is there a *clean* way to make 
render_to_string do what I want?

Michael

-- 
Michael Schuerig
mailto:mich...@schuerig.de
http://www.schuerig.de/michael/

-- 
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] Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-03 Thread Conrad Taylor
On Thu, Jul 1, 2010 at 12:09 PM, cult hero binarypala...@gmail.com wrote:

 I have kind of an interesting problem.

 I have a form wherein people enter information. Big surprise. If they
 enter any weird characters like ø or é or whatever, the form will
 submit and all is well. However, I have a select box for the state
 which, if you're looking at Spain, has states like A Coruña, Cádiz and
 País Vasco. These are pulled from the database which is set to have
 everything encoded in UTF-8. Everything we're doing is in UTF-8.

 However... when it renders the template IF someone used a non-ASCII
 character in a field that appears BEFORE the select I get this error:

 incompatible character encodings: ASCII-8BIT and UTF-8 (on the same
 line as f.select :state)

 If one of the fields AFTER the state field (like the postal code)
 contains a non-ASCII character the error is reversed:

 incompatible character encodings: UTF-8 and ASCII-8BIT (on the same
 line as f.select :postal_code)

 The more I work with encodings in Rails and Ruby in general, the more
 I find myself confused and frustrated. I added config.encoding =
 Encoding::UTF_8 to my application.rb, but that doesn't appear to
 affect templates at all. The problem, so far as I can see, is in one
 of two places:

 I either need to tell Rack to make all my string parameters encoded in
 UTF-8 or I need to set my template default encoding to UTF-8. A quick
 fix is:

 params[:form].each { |k, v| v.force_encoding 'UTF-8' if v.is_a?
 String }

 I know this is not ideal, but I don't understand how the view works
 well enough to do this better.

 What should I do to fix this problem? (Oh, and I'm using ERB, as an
 FYI.)


Hi, I would recommend using Rails 3 Beta 4 and Ruby 1.9.2.  This worked
well for me for the last 4 months.  Next, I would recommend using the
mysql2 gem if you're using mysql2.

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-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@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] Good Linux Distro for Rails 3?

2010-07-03 Thread jason white
I have started using he distro from http://virtualrails.org/, has everything 
ready to go.

Jason


On Jul 1, 2010, at 3:36 PM, Nick Hird wrote:

 This may be the wrong place for this question but i am not sure where to go. 
 
 What is a good linux distro to get started with rails 3? I have given up on 
 ubuntu and any related distro since the version of gem isnt high enough for 
 rails and its related packages. I cant seem to use Arch since they use ruby 
 1.9.1. Is there a distro that has what i need in its package manager so that 
 i can be up and running fairly quickly? I am not the best at getting all the 
 packages running from scratch, so i rely on package managers but that seems 
 to be a loosing battle as well. Any help or recommendations would be 
 appreciated.
 
 ~Nick
 
 
 -- 
 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: Renderer: rendering to *another* format inside a renderer

2010-07-03 Thread Marnen Laibow-Koser
Michael Schuerig wrote:
 My skeletal renderer looks like this
 
   ActionController.add_renderer :pdf do |template, options|
 html = render_to_string(template, options)
 ...
   end
 
 The trouble here is that render_to_string looks for a template for MIME
 type PDF, e.g. show.pdf.erb. Unfortunately, that's not what I want. I
 need to get HTML. 

WTF?  What problem are you trying to solve that means you need to serve 
HTML when a PDF file is requested?  I don't see how that can ever be the 
right thing to do.


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

Sent from my iPhone
-- 
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: Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-03 Thread Fernando Perez
 Good luck,
 
 -Conrad

Hi Conrad, thanks for the tip. Yeah I'm eagerly waiting for Rails 3 to 
get released!

In the mean time I managed to make Rails 2.3.8 play nicely with Ruby 
1.9.1 and that's very painful to do. I would suggest people to stick to 
Ruby 1.8 for some time until everything gets settled. 3rd party gems 
also have to be updated to be compatible with the new 1.9 encoding 
handling.
-- 
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] Doesn't work erb engine

2010-07-03 Thread Jeffrey L. Taylor
Quoting Karen Kalashyan kareni...@gmail.com:
 I'm new in RoR:)
 
 I have controller and view (/app/controllers/greeting_controller.rb
 and /app/views/greeting/index.rhtml /.erb/.html.erb - doesn't match).
 

You don't say which version of Rails you are using, so I will assume 2.x.  If
1.x or 3.x, ignore this reply.

greeting_controller.rb and index.rhtml look fine.  But they are not following
Rails naming conventions, controller names are plural, i.e.,
greetings_controller.rb and /app/views/greetings/.  index.rhtml is old style
naming, preferred current practice is index.html.erb.  These two changes may
be enough to solve your problem.

I don't understand the last bit of the sentence above.  Please expand what you
mean by /.erb/.html.erb - doesn't match.  Do you mean that
/app/view/greeting/index.erb and /app/view/greeting/index.html.erb are ignored
by the template engine?

HTH,
  Jeffrey

-- 
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: Doesn't work erb engine

2010-07-03 Thread Fernando Perez
rename /app/views/greeting/index.rhtml to ./index.html.erb
-- 
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] Limit Ring server to localhost only. RingFinger.new('localhost') apparently doesn't work

2010-07-03 Thread Jeffrey L. Taylor
Quoting koicat pmn...@yahoo.com:
 Am using RingyDingy.
 Have altered call to Rinda::RingFinger.new   to
 Rinda::RingFinger.new('localhost') in ring_server.rb and in
 ringy_dingy.rb, but still get, intermittently, attachments to like
 named services on my compatriots (in the same lan segment) which
 causes things to disappear trying to run on their machine (or on mine
 from theirs).   Need to stop this behavior for development so we can
 work independantly.
 Any suggestions?
 
Is the ring_server really running on localhost?  My experience using
'localhost' is mixed.  I prefer to be explicit and use '127.0.0.1'.  Check if
it really is running on this address, e.g., 'netstat -ant' on most Linux/Unix
based OS.

HTH,
  Jeffrey

-- 
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: Renderer: rendering to *another* format inside a renderer

2010-07-03 Thread Michael Schuerig
On Saturday 03 July 2010, Marnen Laibow-Koser wrote:
 Michael Schuerig wrote:
  My skeletal renderer looks like this
  
ActionController.add_renderer :pdf do |template, options|

  html = render_to_string(template, options)
  ...

end
  
  The trouble here is that render_to_string looks for a template for
  MIME type PDF, e.g. show.pdf.erb. Unfortunately, that's not what I
  want. I need to get HTML.
 
 WTF?  What problem are you trying to solve that means you need to
 serve HTML when a PDF file is requested?  I don't see how that can
 ever be the right thing to do.

I'm passing the HTML into an HTML-to-PDF converter. wkhtmltopdf in my 
case. wicked_pdf does the same, but it works by alias_chain-ing render, 
which I'd like to avoid. Instead, I'm defining a renderer. See

http://www.engineyard.com/blog/2010/render-options-in-rails-3/

Michael

-- 
Michael Schuerig
mailto:mich...@schuerig.de
http://www.schuerig.de/michael/

-- 
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: Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-03 Thread Conrad Taylor


Sent from my iPhone

On Jul 3, 2010, at 11:52 AM, Fernando Perez li...@ruby-forum.com wrote:

 Good luck,
 
 -Conrad
 
 Hi Conrad, thanks for the tip. Yeah I'm eagerly waiting for Rails 3 to 
 get released!
 
 In the mean time I managed to make Rails 2.3.8 play nicely with Ruby 
 1.9.1 and that's very painful to do. I would suggest people to stick to 
 Ruby 1.8 for some time until everything gets settled. 3rd party gems 
 also have to be updated to be compatible with the new 1.9 encoding 
 handling.

I have also have been using Rails 2.3.5 and Ruby 1.9.2 for one project for 6+ 
months.  Thus, it has been super simple to get everything working by using RVM. 
 Thus, it will make it super simple to migrate this project to Rails 3.  
Lastly, if you're using Ruby 1.9.1, then you're definitely using the wrong 
version Ruby because it does have bugs.  Furthermore, Ruby 1.9.2 is the first C 
Ruby version to pass 100% of the RubySpec.  Last but least, Ruby 1.9.2 cleans 
up the Ruby syntax and provides the much needed speed boost in production.

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.



Re: [Rails] Re: Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-03 Thread Conrad Taylor


Sent from my iPhone

On Jul 3, 2010, at 11:52 AM, Fernando Perez li...@ruby-forum.com wrote:

 Good luck,
 
 -Conrad
 
 Hi Conrad, thanks for the tip. Yeah I'm eagerly waiting for Rails 3 to 
 get released!
 
 In the mean time I managed to make Rails 2.3.8 play nicely with Ruby 
 1.9.1 and that's very painful to do. I would suggest people to stick to 
 Ruby 1.8 for some time until everything gets settled. 3rd party gems 
 also have to be updated to be compatible with the new 1.9 encoding 
 handling.

Many gems have been updated to support Ruby 1.9 and it should be super simple 
to fix the ones that are not compatible.  I had a very large code base using a 
lot of gems and plugins.  The ones that had associated tests were much easier 
to fix in general.  Lastly, getting up to speed with the syntax and semantic 
changed made porting for me the easiest as I worked through the various issues. 
 In short, you'll have to make changes to your code either now or later.  Thus, 
I prefer to make incremental improvements over.  For example, moving to Ruby 
1.9.2.  Next, I plan to move to Rails 3.  I go in knowing that somethings will 
not work and will need to be fixed which is a part of software engineering.  
Just create another branch and just do it. :-)

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: Re: Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-03 Thread Fernando Perez
Ruby 1.9.2 is not yet released, I'll wait it goes final to update my 
freebsd port. Until then I'll be running buggy 1.9.1.

My main problem was handling differently encoded strings. So I had to 
add magic comments all over the place, and force_encoding of rdiscount's 
output which is US-ASCII.

Moreove my original language uses accentuated characters so if you only 
write english you might have not run into the same issues as me. But if 
one of your users posts an accentuated char I guess your app will 
explode. Have you tried?

-- 
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: Re: Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-03 Thread Conrad Taylor
On Sat, Jul 3, 2010 at 4:06 PM, Fernando Perez li...@ruby-forum.com wrote:

 Ruby 1.9.2 is not yet released, I'll wait it goes final to update my
 freebsd port. Until then I'll be running buggy 1.9.1.


1.9.2 is currently in preview and I'm using it on several production
applications
with great success.  For me, it works better that 1.9.1.


 My main problem was handling differently encoded strings. So I had to
 add magic comments all over the place, and force_encoding of rdiscount's
 output which is US-ASCII.

 Moreove my original language uses accentuated characters so if you only
 write english you might have not run into the same issues as me. But if
 one of your users posts an accentuated char I guess your app will
 explode. Have you tried?


The application that I'm working on support German, Spanish, Russian,
Japanese, French, Portuguese, and Chinese.

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.comrubyonrails-talk%2bunsubscr...@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] Encoding problems with Rails 3 + Ruby 1.9.1 (big surprise)

2010-07-03 Thread Conrad Taylor
Hi, do you test case that I can run locally because I have done a lot of
work
in this regard?

-Conrad

On Thu, Jul 1, 2010 at 12:09 PM, cult hero binarypala...@gmail.com wrote:

 I have kind of an interesting problem.

 I have a form wherein people enter information. Big surprise. If they
 enter any weird characters like ø or é or whatever, the form will
 submit and all is well. However, I have a select box for the state
 which, if you're looking at Spain, has states like A Coruña, Cádiz and
 País Vasco. These are pulled from the database which is set to have
 everything encoded in UTF-8. Everything we're doing is in UTF-8.

 However... when it renders the template IF someone used a non-ASCII
 character in a field that appears BEFORE the select I get this error:

 incompatible character encodings: ASCII-8BIT and UTF-8 (on the same
 line as f.select :state)

 If one of the fields AFTER the state field (like the postal code)
 contains a non-ASCII character the error is reversed:

 incompatible character encodings: UTF-8 and ASCII-8BIT (on the same
 line as f.select :postal_code)

 The more I work with encodings in Rails and Ruby in general, the more
 I find myself confused and frustrated. I added config.encoding =
 Encoding::UTF_8 to my application.rb, but that doesn't appear to
 affect templates at all. The problem, so far as I can see, is in one
 of two places:

 I either need to tell Rack to make all my string parameters encoded in
 UTF-8 or I need to set my template default encoding to UTF-8. A quick
 fix is:

 params[:form].each { |k, v| v.force_encoding 'UTF-8' if v.is_a?
 String }

 I know this is not ideal, but I don't understand how the view works
 well enough to do this better.

 What should I do to fix this problem? (Oh, and I'm using ERB, as an
 FYI.)

 --
 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.comrubyonrails-talk%2bunsubscr...@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 locals var not being recognized

2010-07-03 Thread Me
Unusual,  I have a render partial with :locals set up but the partial
is not recognizing the var being set.

%= render '/shared/dynamic_attributes', :locals = {:obj =
@equipment } %

Error:

undefined local variable or method `obj' for #ActionView::Base:
0x26bad44

-- 
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 locals var not being recognized

2010-07-03 Thread Kenneth    
Either do

%= render :partial = '/shared/dynamic_attributes', :locals = {:obj = 
@equipment } %

OR

%= render '/shared/dynamic_attributes', :obj = @equipment %
-- 
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] style question: wrapping functionality around existing pkg

2010-07-03 Thread Fearless Fool
My application requires Mechanize with a holdoff, that is, one that
limits its #get and #submit requests to a maximum of one every N
seconds.  I have a simple Governor class which runs a block with a
minimum holdoff between runs:

class Governor
  def with_holdoff(holdoff)
unless (@ran_at.nil? || holdoff.nil?)
  delay = (@ran_at + holdoff) - Time.now
  sleep(delay) if (delay  0)
end
@ran_at = Time.now
yield
  end
end

I could write a class that encapsulates a Mechanize object and wraps a
with_holdoff call around its #get and #submit methods, e.g.:

class WrappedMechanize
  @mechanize = Mechanize.new
  ...
  def get(uri)
@governor.with_holdoff(@holdoff_time) { @mechanize.get(uri) }
  end
end

... but that seems un-rubyish.  What's the cleanest way to extend the
Mechanize functionality?  Perhaps a subclass like this?

class MechanizeWithHoldoff  Mechanize
  ...
  def get_with_holdoff(uri, holdoff_time)
@governor.with_holdoff(holdoff_time) { super.get(uri) }
  end
end

Suggestions welcome.

- ff
-- 
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] DRYing Routes

2010-07-03 Thread dwormuth
I have a series of 'static' pages for a site that need named routes in
Rails 3. I'm trying to DRY the routes file, but can't seem to find the
proper code.

The desired output/code is:

match '/about' = 'info#about', :as = :about

for each page. My attempt to dry this:

%w(about services articles marketing clients).each do |page|
match eval( '/#{page}' = 'info##{page}', :as = :#{page})
end

Any suggestions?

-- 
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: DRYing Routes

2010-07-03 Thread dwormuth
I figured this out:

eval( match '/#{page}' = 'info##{page}', :as = :#{page})


On Jul 3, 10:37 pm, dwormuth dworm...@post.harvard.edu wrote:
 I have a series of 'static' pages for a site that need named routes in
 Rails 3. I'm trying to DRY the routes file, but can't seem to find the
 proper code.

 The desired output/code is:

 match '/about' = 'info#about', :as = :about

 for each page. My attempt to dry this:

 %w(about services articles marketing clients).each do |page|
     match eval( '/#{page}' = 'info##{page}', :as = :#{page})
 end

 Any suggestions?

-- 
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_uniqueness_of fails on update

2010-07-03 Thread Me
According to the docs when you validate on uniqueness it is supposed
to skip the check on the column.  I am getting failed validation on
updates for some reason.  Rails 2.3.5

-- 
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 locals var not being recognized

2010-07-03 Thread Me
Thanks.  I am not sure why but when I was doing CTRL+R  to reload it
was having issues.  When I went back to the index and went to my edit
page it works just fine.  doh...

On Jul 3, 9:24 pm, Kenneth     li...@ruby-forum.com wrote:
 Either do

 %= render :partial = '/shared/dynamic_attributes', :locals = {:obj =
 @equipment } %

 OR

 %= render '/shared/dynamic_attributes', :obj = @equipment %
 --
 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 at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Error in executing the scaffold

2010-07-03 Thread Adriano Dias da Silva
Good night.

I am starting in linux and development in Ruby.
I have not much expertise in this area.
I'm using ruby + rails + postgres + RadRails.

I generated a CRUD for testing as follows below:
scaffold Teste nome:string login:string senha:string

When I run this application showing the following error:

NameError in Testes#index

Showing app/views/testes/index.html.erb where line #24 raised:

undefined local variable or method `new_teste_path' for
#ActionView::Base:0xb6f93560

Extracted source (around line #24):

21:
22: br /
23:
24: %= link_to 'New teste', new_teste_path %

RAILS_ROOT: /home/adriano/Aptana Studio Workspace/teste
Application Trace | Framework Trace | Full Trace

app/views/testes/index.html.erb:24
app/controllers/testes_controller.rb:7:in `index'
-e:2:in `load'
-e:2

Please help me solve this problem.

Thanks ...

Best Regards
Adriano Dias da Silva

-- 
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: Good Linux Distro for Rails 3?

2010-07-03 Thread Agoofin
Ubuntu works well, but I would use rvm with rails - very good
experience with me using it/

On Jul 1, 4:36 pm, Nick Hird nrh...@gmail.com wrote:
 This may be the wrong place for this question but i am not sure where to go.

 What is a good linux distro to get started with rails 3? I have given up on
 ubuntu and any related distro since the version of gem isnt high enough for
 rails and its related packages. I cant seem to use Arch since they use ruby
 1.9.1. Is there a distro that has what i need in its package manager so that
 i can be up and running fairly quickly? I am not the best at getting all the
 packages running from scratch, so i rely on package managers but that seems
 to be a loosing battle as well. Any help or recommendations would be
 appreciated.

 ~Nick

-- 
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] cannor rake db:create

2010-07-03 Thread Dd Ss
I get this error message

 denniss$ rake db:create
(in /Users/denniss/Documents/RoR/blog)
Couldn't create database for {adapter=mysql, database=blog,
encoding=utf8, pool=5, username=root,
password=denniss,
socket=/Applications/rubystack/mysql/tmp/mysql.sock}, charset:
utf8, collation: utf8_unicode_ci (if you set the charset manually, make
sure you have a matching collation)

note that I installed rubystack but I always use the ruby inside

denniss$ which ruby
/usr/local/bin/ruby

denniss$ which mysql
/Applications/rubystack/mysql/bin/mysql
-- 
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.