[Rails] Re: Rails making it tougher for newbies?

2009-03-21 Thread Power One

Thank so much for your guides guys!  Ruby is so elegant that I'm falling 
in love with Rails too.  It's funny that I heard the hype of rails but 
didn't bought into it like most people until I saw Ruby's elegant codes. 
I'm not a programmer but I have learn a little C, Visual Basic, PHP, and 
don't remember any of those :).  Especially PHP, I saw how useful it is 
as it has large base of open source software, but whenever I look at its 
code, I think to myself, it is a mess.  I put off learning coding for 
very long time, and just concentrating in some networking stuffs, but I 
picked up a Ruby books from Barnes and Noble once, and I fell in love 
with Ruby :).  Maybe because I like the idea of bringing art and fun 
into programming than anything else.  Plus, Ruby is so easy to 
understand and to play around with than other programming language, at 
least I didn't yawn when I read the examples :).

Rails is a plus :).
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Emailing

2009-03-21 Thread Shelly

Hi,

I am trying to send emails out using ActionMailer.  Currently, the
console shows that everything is sending out correctly, but I am not
actually receiving any emails.

Thanks in advance,

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



[Rails] Re: Rails making it tougher for newbies?

2009-03-21 Thread Bob Martens

I think that in the future we're going to be relying less and less on
books in the traditional sense and more and more on up-to-date,
community sponsored and updated documentation to handle a lot of what
books handle right now ... especially when working with fast-moving
web frameworks like Rails.

That's just what I see. Rails Guides is an incredible resource, and I
hope that the Wiki will become even more of an extension of the Guides
than it might have been in the past.

If you are looking for some books to get started with, check out
Simply Rails 2 (still mostly relevant), Learning Rails, and Agile Web
Development with Rails (3rd Edition). Those three are the three I
recommend at the moment, but you always need to be aware that you will
have to fill in blanks and think on your feet.

On Mar 21, 5:12 pm, Power One 
wrote:
> I'm trying to learn how to use ruby on rails.  Just two weeks ago I'm
> learning how to program in Ruby, but now I'm ready to get onto with
> rails.  I got a book for rails but it shows me rails examples that only
> work with rails 1.2.3.  I follow the examples, but many are not working.
> For example, scaffold is not working with 2.1.0 (rails version install
> in my computer.
>
> My question is, how do you go about scaffold in rails 2.1.0?  Some
> pagination is not working out of the box such as will_pagination and
> classic_pagination.  Ubuntu 8.10 is making rails more difficult, and
> installing will_pagination from gems didn't do the trick.
>
> Anyone know a complete tutorial that teaches how to install all
> necessary gems/plugins/debian packages that will help me smooth-sailing
> in my ruby on rails adventure?  Thank You.
>
> Also I couldn't find a good beginning ruby on rails book that is
> up-to-date, and I know ruby on rails is a very fast moving framework as
> ruby is also a very fast moving programming language -- things are
> changing constantly for the better.  Any guide to better rails way?
>
> Thanks...
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Problem running autotest in rails 2.3

2009-03-21 Thread Phor Gruber

People,

I'm trying to run autotest on rails 2.3

I get a NoMethodError.

Here is what I see:

Sat Mar 21 20:47 /b/tmp/myfc23 maco$
Sat Mar 21 20:47 /b/tmp/myfc23 maco$ autotest
loading autotest/rails_rspec
./vendor/plugins/rspec/lib/autotest/rspec.rb:24:in `initialize':
undefined method `failed_results_re=' for
# (NoMethodError)
from
/pt/r1/lib/ruby/gems/1.8/gems/ZenTest-3.8.0/lib/autotest.rb:126:in `new'
from
/pt/r1/lib/ruby/gems/1.8/gems/ZenTest-3.8.0/lib/autotest.rb:126:in `run'
from /pt/r1/lib/ruby/gems/1.8/gems/ZenTest-3.8.0/bin/autotest:48
from /pt/r1/bin/autotest:19:in `load'
from /pt/r1/bin/autotest:19
Sat Mar 21 20:47 /b/tmp/myfc23 maco$
Sat Mar 21 20:47 /b/tmp/myfc23 maco$

Here is info about my rails:


Sat Mar 21 20:47 /b/tmp/myfc23 maco$
Sat Mar 21 20:47 /b/tmp/myfc23 maco$
Sat Mar 21 20:47 /b/tmp/myfc23 maco$ script/about
About your application's environment
Ruby version  1.8.7 (i686-darwin9.6.2)
RubyGems version  1.3.1
Rack version  1.0 bundled
Rails version 2.3.2
Active Record version 2.3.2
Action Pack version   2.3.2
Active Resource version   2.3.2
Action Mailer version 2.3.2
Active Support version2.3.2
Application root  /b/tmp/myfc23
Environment   development
Database adapter  sqlite3
Database schema version   2
Sat Mar 21 20:51 /b/tmp/myfc23 maco$

Here is a list of my gems:

*** LOCAL GEMS ***

actionmailer (2.3.2, 2.2.2)
actionpack (2.3.2, 2.2.2)
activerecord (2.3.2, 2.2.2)
activeresource (2.3.2, 2.2.2)
activesupport (2.3.2, 2.2.2)
cgi_multipart_eof_fix (2.5.0)
chronic (0.2.3)
columnize (0.3.0)
daemons (1.0.10)
darkfish-rdoc (1.1.5)
diff-lcs (1.1.2)
extlib (0.9.10)
fastthread (1.0.1)
gem_plugin (0.2.3)
highline (1.5.0)
hoe (1.9.0)
hpricot (0.6.164)
libxml-ruby (0.9.8)
linecache (0.43)
mongrel (1.1.5)
mysql (2.7)
newgem (1.2.3)
rack (0.9.1)
rails (2.3.2, 2.2.2)
rake (0.8.4, 0.8.3)
rcov (0.8.1.2.0)
rdoc (2.4.1)
RedCloth (4.1.9)
rhodes (0.3.0)
rspec (1.2.0, 1.1.12)
rspec-rails (1.2.0, 1.1.12)
rubigen (1.5.2)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
rubyforge (1.0.3)
sqlite3-ruby (1.2.4, 1.2.3)
syntax (1.0.0)
templater (0.5.0)
ZenTest (3.8.0)

Any tips on debugging this?

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

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



[Rails] Re: How to restart an app under Passenger

2009-03-21 Thread Greg Donald

On Sat, Mar 21, 2009 at 11:02 PM, avramd  wrote:
> However I can't figure out how to trigger Passenger to
> realize that I've changed my code.
>
> Any ideas?


touch tmp/restart.txt



-- 
Greg Donald
http://destiney.com/

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



[Rails] Re: can't activate rails (= 2.2.2, runtime), already activated rails-2.3.2

2009-03-21 Thread tadatoshi

Hi,

It turned out that commands/process/spawner that is used by Capistrano
was deprecated in Ruby on Rails 2.3.2.
And it was extracted to irs_process_scripts plugin.
(http://github.com/rails/irs_process_scripts/tree/master)

After I installed the plugin (script/plugin install
git://github.com/rails/irs_process_scripts.git), the error stopped
occurring and Capistrano worked as before.

Thank you.

Sincerely,
Tadatoshi


On Mar 21, 8:57 pm, tadatoshi  wrote:
> Hi,
>
> I have updated from Ruby on Rails 2.2.2 to 2.3.2.
> I have managed to run it both on my Mac OS X and Ubuntu server.
> (script/server -e production)
>
> But when I tried to run it using Capistrano, I got an error. (cap
> deploy:start).
> (I replaced my home directory name etc. with --- in the following):
>
> *** [err :: ---.org] /usr/local/lib/site_ruby/1.8/rubygems.rb:149:in
> `activate'
> *** [err :: ---.org] :
> *** [err :: ---.org] can't activate rails (= 2.2.2, runtime), already
> activated rails-2.3.2
> *** [err :: ---.org] (
> *** [err :: ---.org] Gem::Exception
> *** [err :: ---.org] )
> *** [err :: ---.org] from /usr/local/lib/site_ruby/1.8/rubygems/
> custom_require.rb:35:in `require'
> *** [err :: ---.org] from /home//public_html/.ca/current/
> script/process/spawner:3
>
> In Capfile, I commented out the line:
> Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
> because I thought a plugin may be requiring Ruby on Rails 2.2.2.
> But still same error showed up.
>
> Has anybody encountered this problem?
>
> When I start with "script/server -e production", there is no problem
> and the application is running without a problem. So I doubt that it's
> a problem of some gem requiring Ruby on Rails 2.2.2.
>
> Maybe it's a problem only with Capistrano and it may not be related to
> this mailinglist.
>
> But any help will be greatly appreciated.
>
> Tadatoshi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] How to restart an app under Passenger

2009-03-21 Thread avramd

Hello,

I'm running a rails app on Dreamhost, which uses Passenger. Sometimes
I have a very tiny change to make in my code, and have it take effect
immediately. However I can't figure out how to trigger Passenger to
realize that I've changed my code.

The only thing I know how to do that works is to re-deploy my
application via capistrano, which does a full SVN export to a brand-
new directory, which of course completely replaces the entire rails
app directory structure with a new one. Apparently Passenger figures
that out.

However I have not been able to figure out a single smaller step that
Passenger will notice. I've even tried "touch"ing the entire directory
structure with the current date/time, and Passenger seems to happily
ignore that.

Any ideas?

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



[Rails] Re: Sending & Recieving Mail

2009-03-21 Thread Richard Schneeman

I've tried that, it doesn't work. I was successfully able to find a 
workaround using an observer, but i would still think that this type of 
action Should be possible.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: mysql encoding with rails 2.3.2 and ruby 1.9.1

2009-03-21 Thread Jeremy Kemper

On Sat, Mar 21, 2009 at 7:52 AM, ruby.freeman  wrote:
>
> when I run console with ruby 1.9.1 and rails 2.3.2, and trying to do
> something like
>
> User.first.name.encoding
>
> I'm getting #, though I've set "encoding: utf8"
> in database.yml
>
> any suggestions?

The mysql driver is not encoding-aware yet.

jeremy

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



[Rails] Re: Rails making it tougher for newbies?

2009-03-21 Thread Phlip

Power One wrote:

> My question is, how do you go about scaffold in rails 2.1.0?

Forget scaffolds. They are just the bait - the teaser.

Learn Rails by learning to...

  - create a model with script/generate
  - create its migration into a database
  - write unit tests which force that model to have methods
  - integrate your code into git or svn
  - paint a page in HTML
  - use tidy to clean it up
  - create a controller & its view
  - convert it to html.erb, in the view
  - run your app with webrick and look at it
  - put <%= tags %> into it
  - write tests showing the tags do the right thing

That's the core cycle. Anything else - billions of topics, including threading, 
paging, Ajax, etc, you must Google for, after you understand and work that core 
cycle. And all the books cover the core cycle (right??!).

-- 
   Phlip


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



[Rails] Re: undefined method 'define_a_column' for class 'OCI8::Cursor'

2009-03-21 Thread pepe

Never mind.

I installed oci8 as a gem and it seemed not to like it. I uninstalled
the gem and then donwloaded the version that needs to be installed by
running a ruby program and now everything is happy.

Sorry for the interruption.

Pepe

On Mar 21, 10:29 pm, pepe  wrote:
> Hello. Tired of searching and finding nothing useful.
>
> Moving application to laptop for trip.
>
> Installed:
> - Ruby (1.8.6, patchlevel 111)
> - Rails (2.2.2)
> - Oracle adapter (1.0.0.9250)
> - ruby-oci8 (2.0.1)
> - Oracle 10g Express Edition
>
> database.yml:
> development:
>   adapter:  oracle
> etc...
>
> When I start Mongrel (ruby script/server) I get the error above. I've
> looked everywhere I can think of. Any ideas what might be happening?
>
> Thanks a lot.
>
> Pepe
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] undefined method 'define_a_column' for class 'OCI8::Cursor'

2009-03-21 Thread pepe

Hello. Tired of searching and finding nothing useful.

Moving application to laptop for trip.

Installed:
- Ruby (1.8.6, patchlevel 111)
- Rails (2.2.2)
- Oracle adapter (1.0.0.9250)
- ruby-oci8 (2.0.1)
- Oracle 10g Express Edition

database.yml:
development:
  adapter:  oracle
etc...

When I start Mongrel (ruby script/server) I get the error above. I've
looked everywhere I can think of. Any ideas what might be happening?

Thanks a lot.

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



[Rails] can't activate rails (= 2.2.2, runtime), already activated rails-2.3.2

2009-03-21 Thread tadatoshi

Hi,

I have updated from Ruby on Rails 2.2.2 to 2.3.2.
I have managed to run it both on my Mac OS X and Ubuntu server.
(script/server -e production)

But when I tried to run it using Capistrano, I got an error. (cap
deploy:start).
(I replaced my home directory name etc. with --- in the following):

*** [err :: ---.org] /usr/local/lib/site_ruby/1.8/rubygems.rb:149:in
`activate'
*** [err :: ---.org] :
*** [err :: ---.org] can't activate rails (= 2.2.2, runtime), already
activated rails-2.3.2
*** [err :: ---.org] (
*** [err :: ---.org] Gem::Exception
*** [err :: ---.org] )
*** [err :: ---.org] from /usr/local/lib/site_ruby/1.8/rubygems/
custom_require.rb:35:in `require'
*** [err :: ---.org] from /home//public_html/.ca/current/
script/process/spawner:3

In Capfile, I commented out the line:
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
because I thought a plugin may be requiring Ruby on Rails 2.2.2.
But still same error showed up.

Has anybody encountered this problem?

When I start with "script/server -e production", there is no problem
and the application is running without a problem. So I doubt that it's
a problem of some gem requiring Ruby on Rails 2.2.2.

Maybe it's a problem only with Capistrano and it may not be related to
this mailinglist.

But any help will be greatly appreciated.

Tadatoshi




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



[Rails] Clean way to handle prices

2009-03-21 Thread Fernando Perez

Hi,

Currently I am storing my prices as cents. I have one major issue, it is
the way I convert this value into a decimal looking price. This is done
easily with to_f and *100).to_i, but it looks ugly and clutters my
controllers specially when updating the record. I tried with callbacks,
but it doesn't do the trick if validation fails, as it returns the raw
values, i.e in cents.

I tried redefining price and price=, but it caused a stack too deep
problem with infinite self referential.

What's the consensus on that? Use the Money gem? I expected to have a
nice rubyish solution to that problem.


Best regards,
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Getting Rails to send email

2009-03-21 Thread Jason Arora

Hey Peter,

Nicolai is correct, this isn't really the right place for this kind of
question. However, because I have recently setup a Postfix mail agent
on Slicehost, I might be able to help you. Their documentation is
actually really good. Additionally, if you just need outgoing mail
(like sending emails to admin), then you probably won't even have to
configure ActionMailer (the default settings should work).

Check out the docs and if you are still having trouble, shoot me an
email.
http://articles.slicehost.com/2008/7/29/postfix-installation

HTH,
Jason Arora

On Mar 21, 5:09 pm, Codeblogger  wrote:
> 2009/3/21 Peter Hickman 
>
>
>
> > No quite what I was looking for. I have seen plenty of documentation
> > as to how to send mail from Ruby but they all assume that you have an
> > MTA like sendmail, postfix or exim4 already set up. The machine that I
> > have has neither installed or, obviously, configured.
>
> Hi Peter,
>
> answering this question is out of the scope of this mailing list. You will
> find plenty of mail server installation guides via your favorite search
> enginee - or you can you existing mail accounts (see guides.rails.info).
>
> Regards
> Nicolai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Getting Rails to send email

2009-03-21 Thread Codeblogger
2009/3/21 Peter Hickman 

>
> No quite what I was looking for. I have seen plenty of documentation
> as to how to send mail from Ruby but they all assume that you have an
> MTA like sendmail, postfix or exim4 already set up. The machine that I
> have has neither installed or, obviously, configured.
>

Hi Peter,

answering this question is out of the scope of this mailing list. You will
find plenty of mail server installation guides via your favorite search
enginee - or you can you existing mail accounts (see guides.rails.info).

Regards
Nicolai

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



[Rails] Re: Refreshing browser after form submit and redirect bug

2009-03-21 Thread Fernando Perez

> Let's say I have a form I submit restfully to the update action of a
> controller. On successful update, the application redirects to the index
> action.
> 
> Now in some of my forms if I hit the refresh button on my index page,
> the browser wants to resubmit the form! How is that possible? I can see
> in my log file that I got a 302.

I finally got it fixed! I wasn't redirecting to the correct named_route, 
but to resources_url instead, so Rails thought that I wanted to still 
keep the POST data.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Authentication plugins

2009-03-21 Thread alyoshka

I rolled my own simple but secure authentication system with less than
100 lines of code, with a few parts loosely based on restful
authentication. I was frustrated with all the current solutions, until
I took a look at AuthLogic. I think I'll be using that in my next
project.

One question though, which authorization plugins/gems would be a good
compliment to AuthLogic and which authorization system is the best
right now anyways?

On Mar 20, 11:30 am, Chris Warren  wrote:
> I too have had better luck with AuthLogic. For me I think it was not so
> much a matter of the plugin itself, but I found the AuthLogic
> documentation, tutorials, and examples to be easier to follow. YMMV.
>
>     -Chris Warren
>
>
>
> "Wolas!" wrote:
> > having used both, i suggest authlogic. It has been easier for me to
> > put in (and take out) than rest_auth, which is quite a big plugin and
> > fills your user class. then again, im sure both have their pros and
> > cons
>
> > On Mar 20, 11:18 am, denzy  wrote:
>
> >> Here I was found detail tutorial for autenthication
> >> (restful_authentication):
>
> >>http://railsforum.com/viewtopic.php?id=14216
>
> >> On Mar 20, 7:03 am, ricardonns  wrote:
>
> >>> Hey there.
>
> >>> I am starting a new development and am still a newbie in rails, so i'd
> >>> like to ask witch authentication plugin do you sugest?
>
> >>> Regards,
> >>> Ricardo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Rails making it tougher for newbies?

2009-03-21 Thread Eric

Books are very much lagging indicators of the state of Ruby on Rails.
The best documentation (for better or worse) is on the web. Start at
http://guides.rubyonrails.org/

On Mar 21, 3:12 pm, Power One 
wrote:
> I'm trying to learn how to use ruby on rails.  Just two weeks ago I'm
> learning how to program in Ruby, but now I'm ready to get onto with
> rails.  I got a book for rails but it shows me rails examples that only
> work with rails 1.2.3.  I follow the examples, but many are not working.
> For example, scaffold is not working with 2.1.0 (rails version install
> in my computer.
>
> My question is, how do you go about scaffold in rails 2.1.0?  Some
> pagination is not working out of the box such as will_pagination and
> classic_pagination.  Ubuntu 8.10 is making rails more difficult, and
> installing will_pagination from gems didn't do the trick.
>
> Anyone know a complete tutorial that teaches how to install all
> necessary gems/plugins/debian packages that will help me smooth-sailing
> in my ruby on rails adventure?  Thank You.
>
> Also I couldn't find a good beginning ruby on rails book that is
> up-to-date, and I know ruby on rails is a very fast moving framework as
> ruby is also a very fast moving programming language -- things are
> changing constantly for the better.  Any guide to better rails way?
>
> Thanks...
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] ApplicationHelper::WillPaginate (NameError)

2009-03-21 Thread Fresh Mix

What wrong?

environment.rb

require "will_paginate"


application_helper.rb

include WillPaginate::ViewHelpers
def will_paginate_with_i18n(collection, options = {})
will_paginate_without_i18n(collection, options.merge(:previous_label =>
I18n.t(:previous), :next_label => I18n.t(:next)))
end
alias_method_chain :will_paginate, :i18n



/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in
`load_missing_constant': uninitialized constant
ApplicationHelper::WillPaginate (NameError)
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Rails making it tougher for newbies?

2009-03-21 Thread Power One

I'm trying to learn how to use ruby on rails.  Just two weeks ago I'm
learning how to program in Ruby, but now I'm ready to get onto with
rails.  I got a book for rails but it shows me rails examples that only
work with rails 1.2.3.  I follow the examples, but many are not working.
For example, scaffold is not working with 2.1.0 (rails version install
in my computer.

My question is, how do you go about scaffold in rails 2.1.0?  Some
pagination is not working out of the box such as will_pagination and
classic_pagination.  Ubuntu 8.10 is making rails more difficult, and
installing will_pagination from gems didn't do the trick.

Anyone know a complete tutorial that teaches how to install all
necessary gems/plugins/debian packages that will help me smooth-sailing
in my ruby on rails adventure?  Thank You.

Also I couldn't find a good beginning ruby on rails book that is
up-to-date, and I know ruby on rails is a very fast moving framework as
ruby is also a very fast moving programming language -- things are
changing constantly for the better.  Any guide to better rails way?

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

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



[Rails] Re: Where is my message

2009-03-21 Thread Damjan Rems

Frederick Cheung wrote:
> On Mar 20, 6:46 Damjan Rems 
> wrote:
>> Yes where my program is doing control, but this is ROR's buildin method.
>> Where does it put the message?
>>
> Sorry, without seeing some code I'm not at all sure what you're on
> about.
> 
> Fred

Nevermind. I found out that it is in AR model errors method.

In my case @mailadress.errors

thanks anyway


by
TheR

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

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



[Rails] Re: using transaction the right way

2009-03-21 Thread Kad Kerforn

Frederick Cheung wrote:
> On 21 Mar 2009, at 11:15, Kad Kerforn wrote:
> 
>>
>> I wonder if my transaction is well written ?
>> I create the user record first , then the issue record (no validation)
>> if the user record is valid and saved
>> if anything happen when saving the issue, I want to rollback the user
>> record...
>>
> It looks a bit odd - you always raise ActiveRecord::Rollback, no
> matter what happened.
> In case you did't know, if an exception is raised inside the
> tranasaction block then a rollback will happen for you automatically.
> 
> Fred

Yes sorry..  this line should have been deleted..
is the remaining  code OK ?

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

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



[Rails] Re: cannot migrate back

2009-03-21 Thread Frederick Cheung



On Mar 21, 9:01 pm, Phlip  wrote:
> > That should be VERSION=0 - it's case sensitive (at least in the unix
> > world)
>
> It's case sensitive, because it goes into ENV['VERSION'], without 
> embellishment,
> inside Ruby...

ENV isn't a hash though so ENV[] can do whatever it wants (perhaps if
that was the norm for the platform in question - i don't know enough
about windows to comment). The ENV_IGNORECASE #define in the ruby
source seems particularly relevant.

Fred
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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 2.2.2 - Mysql::Error: MySQL server has gone away

2009-03-21 Thread Andrew Roth

I'm getting these MySQL server has gone away on SHOW FIELDS too.  I've
spent a fair bit of effort trying to figure out what's going on, with
no success.  All we've determined is it seems to have a higher chance
of happening after some idle time.  I can usually make it happen by
hitting an ajax page with many requests at once (just spamming the
ajax).  Any ideas welcome.

On Mar 2, 10:56 pm, Adeel Ahmad 
wrote:
> My app consists of receiving emails with image attachments from its
> users so I have been employing the MMS2R gem and Fetcher. Every 60
> seconds the app goes to the email server to fetch emails.
>
> Under Rails 2.1.1 things worked fine - when I received an email, the
> email was fetched, parsed and saved to the database.
>
> However I needed to upgrade to Rails 2.2.2 for unrelated reasons and now
> I get the following error in my log when the app tries to save to the
> database. Emailpic is just the model in the database.
>
> "Emailpic Columns (0.0ms)   Mysql::Error: MySQL server has gone away:
> SHOW FIELDS FROM `emailpics`"
>
> Does anyone know what changed between 2.1.1 and 2.2.2 to cause this to
> happen?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: cannot migrate back

2009-03-21 Thread Luma

thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: cannot migrate back

2009-03-21 Thread Phlip

> That should be VERSION=0 - it's case sensitive (at least in the unix
> world)

It's case sensitive, because it goes into ENV['VERSION'], without 
embellishment, 
inside Ruby...


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



[Rails] Re: cannot migrate back

2009-03-21 Thread Frederick Cheung



On Mar 21, 8:40 pm, Luma  wrote:
> hi,
>
> I can't run back my migrations on Ubuntu:
>
> rake db:migrate works as expected. I.e. after that, schema_migrations
> includes some numbers. Then I run this in ubuntu's terminal:
>
> u...@ubuntu:~/project/src$ rake db:migrate version=0 --trace

That should be VERSION=0 - it's case sensitive (at least in the unix
world)

Fred
> (in /home/user/project/src)
> ** Invoke db:migrate (first_time)
> ** Invoke environment (first_time)
> ** Execute environment
> ** Execute db:migrate
> ** Invoke db:schema:dump (first_time)
> ** Invoke environment
> ** Execute db:schema:dump
> u...@ubuntu:~/project/src$
>
> Nothing happened, and schema_migration includes the same numbers as
> before.
>
> I have this problem with Rails 2.2.2 on Ubuntu 8.10 in development
> mode, but not with Rails 2.0.2 and Windows Vista, also development.
>
> I'm wondering why nobody seems to have the same problem... How can I
> get it work?
>
> Luma
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Action Mailer problem

2009-03-21 Thread Tam Kbe

Hello,

I'm trying to make my rails app send mail.

I'm using Postfix + Dovecot + SASL on Linux Debian VPS:
http://www.debianadmin.com/debian-mail-server-setup-with-postfix-dovecot-sasl-squirrel-mail.html

I'm using the following configuration in environment.rb:

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address => "localhost",
  :port => 25,
  :domain => "domain.com",
  :user_name => "user",
  :password => "password",
  :authentication => :plain
}

I see the following error:
/!\ FAILSAFE /!\  Sat Mar 21 13:40:53 -0700 2009
  Status: 500 Internal Server Error
  535 5.7.0 Error: authentication failed: authentication failure

/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/1.8/net/smtp.rb:585:in
`auth_login'
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/1.8/net/smtp.rb:570:in
`__send__'
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/1.8/net/smtp.rb:570:in
`authenticate'
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/1.8/net/smtp.rb:410:in
`do_start'
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/1.8/net/smtp.rb:377:in
`start'
/opt/ruby-enterprise-1.8.6-20090201/lib/ruby/1.8/net/smtp.rb:315:in
`start'

/var/www/releases/20090318014324/vendor/rails/actionmailer/lib/action_mailer/base.rb:627:in
`perform_delivery_smtp'

/var/www/releases/20090318014324/vendor/rails/actionmailer/lib/action_mailer/base.rb:508:in
`__send__'

/var/www/releases/20090318014324/vendor/rails/actionmailer/lib/action_mailer/base.rb:508:in
`deliver!'

/var/www/releases/20090318014324/vendor/rails/actionmailer/lib/action_mailer/base.rb:383:in
`method_missing'
/var/www/releases/20090318014324/app/controllers/application.rb:74:in
`log_error'

/var/www/releases/20090318014324/vendor/rails/actionpack/lib/action_controller/rescue.rb:115:in
`rescue_action'

/var/www/releases/20090318014324/vendor/rails/actionpack/lib/action_controller/rescue.rb:203:in
`perform_action_without_caching'

/var/www/releases/20090318014324/vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in
`perform_action'

..

Any ideas?

Thanks,

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

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



[Rails] cannot migrate back

2009-03-21 Thread Luma

hi,

I can't run back my migrations on Ubuntu:

rake db:migrate works as expected. I.e. after that, schema_migrations
includes some numbers. Then I run this in ubuntu's terminal:

u...@ubuntu:~/project/src$ rake db:migrate version=0 --trace
(in /home/user/project/src)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump
u...@ubuntu:~/project/src$

Nothing happened, and schema_migration includes the same numbers as
before.

I have this problem with Rails 2.2.2 on Ubuntu 8.10 in development
mode, but not with Rails 2.0.2 and Windows Vista, also development.

I'm wondering why nobody seems to have the same problem... How can I
get it work?

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



[Rails] Re: Problem when trying to freeze gem (XP user)

2009-03-21 Thread Matt Jones

There's still something really weird going on with your Rubygems
install, but I haven't got any ideas on how to debug it. Maybe some
other Windows users here can help? It wouldn't hurt, of course, to do
the standard Windows troubleshooting routine (remove your Ruby install
and try again)...

Freezing to edge works, but I'd encourage you to upgrade to 2.3.2 if
at all possible. While the shiny new features may get all the press,
there are *many* bug fixes in there as well.

--Matt Jones

On Mar 19, 10:33 am, sultan  wrote:
> Hi Matt,
>
> In my "my documents" directory (outside of Aptana Studio) I created a
> new project "rails testout -d mysql", then in the testout directory
> (cd testout) I tried "rake rails:freeze:gems" and still get the same
> error. I can't figure out why this won't work.
>
> I then created a new project in Apatana Studio "testin". I then did
> (in the command line) the rails:freeze:edge RELEASE=2.2.2 step
> manually and made sure that I unzipped the file in /testin/vendor
> directory. It seems to work. I can start the server and run rake jobs.
> The only thing missing is rails/
> REVISION_dc88847e5ce392eed210b97525c14fca55852867. Do you think this
> is a good work around?
>
> On Mar 18, 12:34 pm, sultan  wrote:
>
> > I guess I am running 1.3.1. I thought I was running 2.2.2
>
> > On Mar 18, 12:16 pm, Matt Jones  wrote:
>
> > > On Mar 17, 10:35 am, sultan  wrote:
>
> > > > I am on XP. This is the first time I am trying to freeze to a gem.
> > > > This is what I get:
>
> > > > rake rails:freeze:gems --trace
> > > > (in C:/Documents and Settings/Sultan/My Documents/Aptana Studio/
> > > > upload)
> > > > ** Invoke rails:freeze:gems (first_time)
> > > > ** Execute rails:freeze:gems
> > > > Freezing to the gems for Rails 2.2.2
> > > > rm -rf vendor/rails
> > > > mkdir -p vendor/rails
> > > > cd vendor/rails
> > > > Unpacked gem: 'C:/Documents and Settings/Sultan/My Documents/Aptana
> > > > Studio/upload/vendor/rails/activesupport-2.2.2'mv activesupport-2.2.2
> > > > activesupport
>
> > > > rm -rf vendor/rails
> > > > rake aborted!
> > > > Permission denied - activesupport-2.2.2 or activesupport
>
> > > If you manually unpack the activesupport-2.2.2 gem, can you rename the
> > > directory it creates? Try this at the command line:
>
> > > gem unpack activesupport --version '= 2.2.2'
> > > mv activesupport-2.2.2 activesupport
>
> > > Also, for reference, what version of Rubygems are you running (do a
> > > 'gem --version')?
>
> > > CC me directly for quicker replies.
>
> > > --Matt Jones
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: is the default mysql adapter gem 3 years old?

2009-03-21 Thread Hubert Łępicki

I do not have mysql gem installed at lall - all I use is libmysql-
ruby1.8 library from Ubuntu apt repository. I think this is preferred
way of getting MySQL to work - but please correct me if I'm wrong and
should use gem instead...

On 21 Mar, 17:46, Andrew Roth  wrote:
> Hello,
>
> There must be some obvious explanation that I'm missing, but I can't
> figure out why gem install mysql -- as many guides messages instruct
> -- wants to install v 2.7 of the adapter.  I've tried it on a number
> of recently installed systems with recent rubygems, and they all want
> to install v 2.7.  That version is three and a half years old!
>
> Why aren't the newer versions in the gem list?  Why aren't the older
> versions available?  Do people just use their distribution's mysql
> adapter?  Is it that 2.7 does the job so nobody bothers to upgrade?
>
> $ gem list --remote mysql
>
> *** REMOTE GEMS ***
>
> mysql (2.7.3, 2.7)
> mysql_replication_adapter (0.4.0)
> mysql_retry_lost_connection (0.0.1)
>
> Ok, let's try installing v 2.7.3 as it says that version's available..
>
> $ sudo gem install -v 2.7.3 mysql
> ERROR:  could not find gem mysql locally or in a repository
>
> Hmm, ok, let's just install it
>
> $ sudo gem install mysql -- --with-mysql-config=`which mysql_config`
> Building native extensions.  This could take a while...
> Successfully installed mysql-2.7
> 1 gem installed
>
> I wonder what other versions there are
>
> $ gem list --details mysql
>
> *** LOCAL GEMS ***
>
> mysql (2.7)
>     Author:
>     Homepage:http://www.tmtm.org/en/mysql/ruby/
>     Installed at: /opt/local/lib/ruby/gems/1.8
>
>     MySQL/Ruby provides the same functions for Ruby programs that the
>     MySQL C API provides for C programs.
>
> Looks likehttp://www.tmtm.org/en/mysql/ruby/history has 2.7 released
> 2005-08-22 (3.5 years ago!), and many newer versions since.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Nginx help

2009-03-21 Thread Fresh Mix

Hi, can somebody help me install Nginx + Rails vhosts (2.2.2 + 2.3.2) +
php support for phpmyadmin?
Server is ubuntu.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: right_http and attachment_fu issues

2009-03-21 Thread Don French

Any Ideas. I am stuck. Right now it looks like I can not have
backup_fu (uses the right stuff) and attachment_fu in the same app. If
that is the case, does anyone have good mysql backup options?

Don French

On Mar 20, 10:10 pm, Don French  wrote:
> I was running attachment_fu with aws::s3 and I added a backup plugin
> that uses the right gems including right_http_connection. Now I get
> the  documented error of wrong number of arguments. There is a comment
> in the read me about it to put the right_httpConnection after the
> attachment_fu.
>
> My problem is how/where do I do that?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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: Ruby/Rails projects "market" site - anyone?

2009-03-21 Thread Hubert Łępicki

Nope? Probably bad idea.

On 20 Mar, 16:33, Hubert Łępicki  wrote:
> Hi guys,
>
> I was wondering how do you look for clients for your Rails companies?
> I know there are places like project4hire.com but these are more
> suitable for individuals I think than companies.
>
> I was supprised to find there is no such "project market" for Rails
> projects out there - anyone interested in developing one? Do you think
> it might be useful / got interest of both developers and clients?
>
> Thanks and looking forward to hear your opinion.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: debugger seems broken with Rails 2.3.2

2009-03-21 Thread Fernando Perez

Fernando Perez wrote:
> With Rails 2.3.2 and ruby-debug 0.10.3 very weird things are happening.
> Am I the only one?

Here is one of the weird behavior: in development mode, if I edit a 
Model, I sometimes notice that the code doesn't get reload when I issue 
the 'list' command in the debugger. Therefore I bang my head not 
understanding why my edits don't make any change.

Therefore I have to ctrl+c and relaunch Thin. Anyone else ran in this 
problem previously?


Best regards,
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: rails's models diagrams

2009-03-21 Thread Matt Jones

I haven't tested it against 2.3, but Railroad can do what you're
asking for:

http://railroad.rubyforge.org/

--Matt Jones

On Mar 19, 3:23 pm, Isaac Amaru Zelaya Orellana 
wrote:
> hi i'm a newbie ror programmer and in my job demand the rails's models
> diagrams to add this plataform to the daily work, i still havent found
> anything so if someone could be so nice to send me one ill be very thanful--
>
> GOOOL!!!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Models distance in terms of associations

2009-03-21 Thread Frederick Cheung



On Mar 21, 6:23 pm, Gabriele Tassoni 
wrote:
> Hi,
> I was wondering if there's a way to know the associations needed to
> reach a model from another, i.e.
> I have a Customer, I know it has some Invoices, each of these has more
> InvoiceRows which belongs to an InvoiceRowDescription, I would like to
> know if there's a way to automagically build something like this (for
> an auto generated named scope's join key):
>

There's not something builtin (although it does sound like it would be
a relatively simple graph traversal exercise to produce something like
this (picking the 'best' path if there were multiple ones might be
trickier)).

Fred
> {:invoices => {:invoice_rows => :invoice_row_description}}
>
> knowing just that the current model is Customer, and the last model is
> InvoiceRowDescription
>
> Thanks,
>
> G.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Stop rendering a response in the default layout

2009-03-21 Thread Matt Jones

That's your problem right there - 2.3.0 (the first RC) had issues with
template handling on javascript requests. See these tickets:

http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2052
http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1844

Upgrading to 2.3.2 will fix this.

--Matt Jones

On Mar 17, 2:36 pm, "tashfeen.ekram"  wrote:
> i am using rails 2.3.0.
>

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



[Rails] Models distance in terms of associations

2009-03-21 Thread Gabriele Tassoni

Hi,
I was wondering if there's a way to know the associations needed to
reach a model from another, i.e.
I have a Customer, I know it has some Invoices, each of these has more
InvoiceRows which belongs to an InvoiceRowDescription, I would like to
know if there's a way to automagically build something like this (for
an auto generated named scope's join key):

{:invoices => {:invoice_rows => :invoice_row_description}}

knowing just that the current model is Customer, and the last model is
InvoiceRowDescription

Thanks,

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



[Rails] Re: Getting Rails to send email

2009-03-21 Thread Marnen Laibow-Koser

Peter Hickman wrote:
> No quite what I was looking for. I have seen plenty of documentation
> as to how to send mail from Ruby but they all assume that you have an
> MTA like sendmail, postfix or exim4 already set up.
[...]

To avoid the hassle of setting up Postfix or similar, I just give 
ActionMailer the connection info for my ISP's SMTP server.  That should 
do the trick.

Best,
--
Marnen Laibow-Koser
mar...@marnen.org
http://www.marnen.org
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] is the default mysql adapter gem 3 years old?

2009-03-21 Thread Andrew Roth

Hello,

There must be some obvious explanation that I'm missing, but I can't
figure out why gem install mysql -- as many guides messages instruct
-- wants to install v 2.7 of the adapter.  I've tried it on a number
of recently installed systems with recent rubygems, and they all want
to install v 2.7.  That version is three and a half years old!

Why aren't the newer versions in the gem list?  Why aren't the older
versions available?  Do people just use their distribution's mysql
adapter?  Is it that 2.7 does the job so nobody bothers to upgrade?

$ gem list --remote mysql

*** REMOTE GEMS ***

mysql (2.7.3, 2.7)
mysql_replication_adapter (0.4.0)
mysql_retry_lost_connection (0.0.1)

Ok, let's try installing v 2.7.3 as it says that version's available..

$ sudo gem install -v 2.7.3 mysql
ERROR:  could not find gem mysql locally or in a repository

Hmm, ok, let's just install it

$ sudo gem install mysql -- --with-mysql-config=`which mysql_config`
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed

I wonder what other versions there are

$ gem list --details mysql

*** LOCAL GEMS ***

mysql (2.7)
Author:
Homepage: http://www.tmtm.org/en/mysql/ruby/
Installed at: /opt/local/lib/ruby/gems/1.8

MySQL/Ruby provides the same functions for Ruby programs that the
MySQL C API provides for C programs.

Looks like http://www.tmtm.org/en/mysql/ruby/ history has 2.7 released
2005-08-22 (3.5 years ago!), and many newer versions since.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: validation for a non active record input field

2009-03-21 Thread Rails List

not even a single person implemented non-active record field 
validation?...please help
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Getting Rails to send email

2009-03-21 Thread Peter Hickman

No quite what I was looking for. I have seen plenty of documentation  
as to how to send mail from Ruby but they all assume that you have an  
MTA like sendmail, postfix or exim4 already set up. The machine that I  
have has neither installed or, obviously, configured.

I was thinking that this is the sort of problem that others must have  
encountered before and perhaps they could shed some light on what I  
should be looking for.

Thanks anyway


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



[Rails] Re: select_tag help

2009-03-21 Thread Scott Kulik

Frederick Cheung wrote:
> On Mar 21, 1:44�pm, Scott Kulik 
> wrote:
>>
> Hashes are not ordered  in ruby 1.8 - if you want an ordering use an
> array (eg  [['Yes', 1], ['No',0]]).
> For an option to be preselected it's value (the second bit) must be
> equal to the last argument to select_tag (equal in the sense of ==, so
> in particular '1' != 1)
> 
> In your case you are passing params[:fake].to_i. If there are no
> parameters then params[:fake] is nil, and nil.to_i == 0 so rails
> selects the option with value 0.
> 
> Fred

thanks fred.  changing to an array fixed the ordering problems.
for the select statement, i changed the initial value for -->Fake to -1

select_tag(:fake, 
options_for_select([["-->Fake","-1"],["Yes",1],["No",0]], 
params[:fake].to_i))

everything works great!
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Charts in Rails

2009-03-21 Thread jdwy

Google Charts stinks; it's the Google Visualization API that you want.
Your data doesn't go to them and the widgets are much better.

On Mar 21, 12:03 am, Unnikrishnan KP  wrote:
> I have tried almost all of the above charting libraries, gnuplot,
> google charts and the flash charts as well. Finally I found
> chartdirector.
>
> http://www.advsofteng.com/download.html
>
> It proved to be very straight forward to use, provided hell lot of
> flexibilty and options.
>
> Its not free(a yellow strip of text will appear at the bottom of
> charts unless we buy the license)
>
> On Mar 21, 7:23 am, Robert Walker 
> wrote:
>
>
>
> > Harold A. Giménez Ch. wrote:
>
> > >> You must have glossed over the OP's requirements
> > > indeed I did. My apologies.
>
> > However, those links you provided look really nice.
> > --
> > Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Validating xml parser?

2009-03-21 Thread Frederick Cheung



On Mar 21, 3:10 pm, Sudhi Kulkarni 
wrote:
> Hi,
>
> Is there any validating xml parsers available with rubu or rubyonrails?
> I tried REXML but that is not a validating parser. All other information
> on the web links to some 3rd partly xml parsers.
>
> I am using rails on Windows and hence cannot use libxml.

Really? http://rubyforge.org/frs/?group_id=494 claims to have
downloads for windows.

Fred

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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] Validating xml parser?

2009-03-21 Thread Sudhi Kulkarni

Hi,

Is there any validating xml parsers available with rubu or rubyonrails?
I tried REXML but that is not a validating parser. All other information
on the web links to some 3rd partly xml parsers.

I am using rails on Windows and hence cannot use libxml. I checked
hpricot but that is a html parser I guess.

Any pointers will be helpful.

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

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



[Rails] mysql encoding with rails 2.3.2 and ruby 1.9.1

2009-03-21 Thread ruby.freeman

when I run console with ruby 1.9.1 and rails 2.3.2, and trying to do
something like

User.first.name.encoding

I'm getting #, though I've set "encoding: utf8"
in database.yml

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-talk@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: select_tag help

2009-03-21 Thread Frederick Cheung



On Mar 21, 1:44 pm, Scott Kulik 
wrote:
> I'm trying to create a select tag for a search form that defaults to
> -->Fake when nothing has been selected.  I have tried using the
> following:
>
> <%= select_tag(:fake, options_for_select({"-->Fake" => "", "Yes" => 1,
> "No" => 0}, params[:fake].to_i)) %>
>
> for some reason though, No is selected initially when no GET parameter
> is passed and the options are not in the correct order.  they show up
> like the following:
>
Hashes are not ordered  in ruby 1.8 - if you want an ordering use an
array (eg  [['Yes', 1], ['No',0]]).
For an option to be preselected it's value (the second bit) must be
equal to the last argument to select_tag (equal in the sense of ==, so
in particular '1' != 1)

In your case you are passing params[:fake].to_i. If there are no
parameters then params[:fake] is nil, and nil.to_i == 0 so rails
selects the option with value 0.

Fred

> No
> -->Fake
> Yes
>
> Can you someone help me out with this?  thanks!
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Dynamically generated form + Saving multiple records at once

2009-03-21 Thread Freddy Andersen

I think you will be happy to watch this screencast

http://railscasts.com/episodes/75-complex-forms-part-3

Its a project that has_many tasks but it talks about exactly the
problem you have with build_segments 3.times...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] select_tag help

2009-03-21 Thread Scott Kulik

I'm trying to create a select tag for a search form that defaults to
-->Fake when nothing has been selected.  I have tried using the
following:

<%= select_tag(:fake, options_for_select({"-->Fake" => "", "Yes" => 1,
"No" => 0}, params[:fake].to_i)) %>

for some reason though, No is selected initially when no GET parameter
is passed and the options are not in the correct order.  they show up
like the following:

No
-->Fake
Yes

Can you someone help me out with this?  thanks!
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Dynamically generated form + Saving multiple records at once

2009-03-21 Thread Marcelo Ruiz

Hi Everybody,

My name is Marcelo Ruiz, software developer from Argentina starting to
work with rails.

I'm building a web app to track traffic information for roads. We have
operators that create Reports associated to each Segment of different
Roads.

I have the following models:

* Road (has_many :segments)
* Segment (belongs_to :road  has_many :reports)
* Report (belongs_to :segment)

The requirement is that I have to show up only one form per Road, so
the operator can load the Reports for all the Segments in that Road at
once.

This would be something similar to this:

Road "Route 55"


Report for Segment 1: (text field)

Report for Segment 2: (text field)

Report for Segment 3: (text field)

(SUBMIT BUTTON)

This means that I will have to:

1. Dinamically generate the fields, according to the number of
segments the selected Road has.
2. Create multiple Reports at the same time.

Any advise on how to do this?

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



[Rails] Re: using transaction the right way

2009-03-21 Thread Frederick Cheung


On 21 Mar 2009, at 11:15, Kad Kerforn wrote:

>
> I wonder if my transaction is well written ?
> I create the user record first , then the issue record (no validation)
> if the user record is valid and saved
> if anything happen when saving the issue, I want to rollback the user
> record...
>
It looks a bit odd - you always raise ActiveRecord::Rollback, no  
matter what happened.
In case you did't know, if an exception is raised inside the  
tranasaction block then a rollback will happen for you automatically.

Fred
>  def infos_send
>@franchise = Franchise.scoped_by_mother_of_all(true).first
>@user = ProspectUser.new(params[:user])
>
>User.transaction do
>  if @user.save
>create_info_request_issue  #private method
>@issue.save
>raise ActiveRecord::Rollback
>flash[:notice] = I18n.t(:notice_successful)
>redirect_back_or_default  :action => 'index'
>  else
>render  :action => 'infos'
>  end
>end
>
>  end
>
> thanks for you help
>
> erwin
> -- 
> Posted via http://www.ruby-forum.com/.
>
> >


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



[Rails] Re: Getting Rails to send email

2009-03-21 Thread vimal

Hi Hickman,

Check out the documentation in 
http://guides.rails.info/action_mailer_basics.html
this is the default module for Rails.


I am using ruport(Ruby reports) to send email

gem install ruport
gem install ruport-util

>> require 'rubygems'
>> require 'ruport'
>> require 'ruport/util'

>> r = Ruport::Report.new
>> r.add_mailer :default, :host => "localhost", :address => "x...@xxx.com"
>> r.send_to(email_id) do |mail|
>>mail.subject = "Some subject"
>>mail.text = "Some text"
>>mail.html = "Hello World"
>> end

For further info. check ruport documentation

Regards,
Vimal Das


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



[Rails] Re: - 2.3.2 uninitialized constant ApplicationController

2009-03-21 Thread vimal

Thanks for the reply Conrad :)

Regards,
Vimal Das


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



[Rails] Getting Rails to send email

2009-03-21 Thread Peter Hickman

I have a site that I want to send out emails for when people forget  
their password. I've read the various articles on how to get Rails to  
send emails but what I need is how to set up the software to allow  
emails to be sent at all. I once say an article that covered setting  
up exim / postfix but can't find it anymore. Does anyone know what  
packages I need to install and how I might configure them or some  
pointers to where I can find this out?

I am running debian 4.0

Thanks


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



[Rails] using transaction the right way

2009-03-21 Thread Kad Kerforn

I wonder if my transaction is well written ?
I create the user record first , then the issue record (no validation)
if the user record is valid and saved
if anything happen when saving the issue, I want to rollback the user
record...

  def infos_send
@franchise = Franchise.scoped_by_mother_of_all(true).first
@user = ProspectUser.new(params[:user])

User.transaction do
  if @user.save
create_info_request_issue  #private method
@issue.save
raise ActiveRecord::Rollback
flash[:notice] = I18n.t(:notice_successful)
redirect_back_or_default  :action => 'index'
  else
render  :action => 'infos'
  end
end

  end

thanks for you help

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

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



[Rails] Re: - 2.3.2 uninitialized constant ApplicationController

2009-03-21 Thread Conrad Taylor
On Sat, Mar 21, 2009 at 3:17 AM, vimal  wrote:

>
> Cool! Thanks Noria...
> Is the rails version 2.3.2 an edge version?
>
> Regards,
> Vimal Das
>

Vimal, Rails 2.3.2 is the most recent release.

-Conrad


>
> >
>

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



[Rails] Re: - 2.3.2 uninitialized constant ApplicationController

2009-03-21 Thread vimal

Cool! Thanks Noria...
Is the rails version 2.3.2 an edge version?

Regards,
Vimal Das

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



[Rails] Re: - 2.3.2 uninitialized constant ApplicationController

2009-03-21 Thread Xavier Noria

On Sat, Mar 21, 2009 at 11:06 AM, vimal  wrote:

> Hi,
>  I just migrated from rails 2.2.2 to 2.3.2
>  The rails app was running fine until i migrated
>  I checked for the application.rb in the controller folder and its
> there
>  Any suggestions, why this is happening???

In 2.3 that's application_controller.rb. Just rename it or run:

   rake rails:update:application_controller

-- fxn

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



[Rails] - 2.3.2 uninitialized constant ApplicationController

2009-03-21 Thread vimal

Hi,
  I just migrated from rails 2.2.2 to 2.3.2
  The rails app was running fine until i migrated
  I checked for the application.rb in the controller folder and its
there
  Any suggestions, why this is happening???

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



[Rails] Re: Rails 2.3 really checks for presence of $RAILS_ROOT/public/index.html

2009-03-21 Thread ruby...@ymail.com



On 21 Mar., 01:28, Sudhir  wrote:
> Just sharing a Rail 2.3.2 upgrade experience. My app was running on
> 2.1.1 before I upgraded.
>
> Most things worked but I could not get my default route in routes.rb
> to work. The default route URL was "/". I had a route like this in
> routes.rb as the very last route:
>
> map.connect "", :controller => "foo", :action => "bar"
>
> So users who went to the base URL would be directed to the foo
> controller.
>
> This stopped working with Rails 2.3.2 and I wasted half a day figuring
> out what was wrong. Turns out, I just needed to delete public/
> index.html. That's it. The same route works perfectly after deleting
> that file.
>
> There is a comment in the Rails code which mentions this but I don't
> see it in the documentation for Rails routes.



On 21 Mar., 01:28, Sudhir  wrote:
> Just sharing a Rail 2.3.2 upgrade experience. My app was running on
> 2.1.1 before I upgraded.
>
> Most things worked but I could not get my default route in routes.rb
> to work. The default route URL was "/". I had a route like this in
> routes.rb as the very last route:
>
> map.connect "", :controller => "foo", :action => "bar"
>
> So users who went to the base URL would be directed to the foo
> controller.
>
> This stopped working with Rails 2.3.2 and I wasted half a day figuring
> out what was wrong. Turns out, I just needed to delete public/
> index.html. That's it. The same route works perfectly after deleting
> that file.
>
> There is a comment in the Rails code which mentions this but I don't
> see it in the documentation for Rails routes.

As far as I know your web server will always look in the /public
directory to see if any files matches the request, if not it will pass
the request on to the app server. So this really shouldn't have worked
before either...

And by the way, you usually use map.root to make a route that matches
a request to the root:

map.root :controller => "foo", :action => "bar"

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



[Rails] Re: Sending & Recieving Mail

2009-03-21 Thread ruby...@ymail.com



On 21 Mar., 06:01, Richard Schneeman  wrote:
> I have written a mailer, when i call:
>
> MyMailer.deliver_welcome("Name", "emailaddr...@gmail.com" )
>
> I successfully send an email to the address that i specify.
>
> I have written a mail recieving client that lives in MyMailer called
> recieve. I can successfully recieve mail with it.
>
>  I am trying to write a "Thanks for the message, we have received it"
> email that replies back the sender of an email. But this line of code
> inside of my MyMailer does not work:
>
>   def receive(email)
>     MyMailer.deliver_welcome("Name", "emailaddr...@gmail.com" )
>   end
>
> Both pieces of code work great separately, but when i try to call the
> deliver_welcome method from within the ActionMailer model i created, for
> some reason it never executes or never executes-properly.
>
> Rails 2.2.2, Ruby 1.8.6, any insight would be tremendously helpful!

This is just a wild guess, but did you try to call the method like
this instead?

def receive(email)
  deliver_welcome("Name", "emailaddr...@gmail.com" )
end

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



[Rails] Re: routes path problem when using link_to_remote

2009-03-21 Thread ruby...@ymail.com



On 21 Mar., 08:40, Shardul Mohite 
wrote:
> Hello there,
>
> My routes.rb has following
>
>   map.resources "parties" , :controller=> "political_parties" ,
> :collection => {:states => :get , :nationals => :get }
>
> In one of my views i was trying to do something like this
>
> <%= link_to_remote "State Parties" , :url=> states_parties_path ,:update
> => {:success => 'parties_list'} %>
>
> But I was getting following error on log
>
> ActionController::MethodNotAllowed (Only get, put, and delete requests
> are allowed.):
>
> Any idea whay this is?

In your routes file you defined that you only wanted GET requests two
the states action. Currently it doesn't work since Prototype makes
POST requests by default. You have two opportunities:

A) Correct your routes file:
  map.resources "parties" , :controller=>
"political_parties" , :collection => {:states => :post , :nationals
=> :get }

B) Correct the link:
  <%= link_to_remote "State Parties" , :url=>
states_parties_path, :update => {:success => 'parties_list'}, :method
=> :get %>

The ActionController::MethodNotAllowed error in general means that you
have attempted to call an action that is not allowed to be called with
that method. E.g. you can't POST to the show action, it only allows
GET.

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



[Rails] Re: Structuring a find that looks at the first letter of a field

2009-03-21 Thread ruby...@ymail.com



On 21 Mar., 09:01, Robert Scott 
wrote:
> I guess the subject is fairly self-explanatory. I'm pretty new to RoR,
> but I'd like to learn how to structure a find that looks at the first
> character of a field, say firstname, to find those that match a
> parameter passed in to the controller.
>
> Hopefully it's not too difficult. :/
> Thanks in advance.

@person = Person,find(:all, :conditions => ["firstname LIKE ?%", params
[:letter]]

The question mark is replaced with params[:letter]. There is plenty of
material on the LIKE keyword on the internet, so if you don't know
what it does, go ahead and do some research.

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



[Rails] right_http and attachment_fu issues

2009-03-21 Thread Don French

I was running attachment_fu with aws::s3 and I added a backup plugin
that uses the right gems including right_http_connection. Now I get
the  documented error of wrong number of arguments. There is a comment
in the read me about it to put the right_httpConnection after the
attachment_fu.

My problem is how/where do I do that?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@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] Structuring a find that looks at the first letter of a field

2009-03-21 Thread Robert Scott

I guess the subject is fairly self-explanatory. I'm pretty new to RoR,
but I'd like to learn how to structure a find that looks at the first
character of a field, say firstname, to find those that match a
parameter passed in to the controller.

Hopefully it's not too difficult. :/
Thanks in advance.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] routes path problem when using link_to_remote

2009-03-21 Thread Shardul Mohite

Hello there,

My routes.rb has following

  map.resources "parties" , :controller=> "political_parties" ,
:collection => {:states => :get , :nationals => :get }

In one of my views i was trying to do something like this

<%= link_to_remote "State Parties" , :url=> states_parties_path ,:update
=> {:success => 'parties_list'} %>

But I was getting following error on log

ActionController::MethodNotAllowed (Only get, put, and delete requests
are allowed.):

Any idea whay this is?
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Migrating rails website from one server to another

2009-03-21 Thread MaD

forgot to state the (even more) obvious: dump your mysql-db to a file
and insert it in your new db.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Migrating rails website from one server to another

2009-03-21 Thread MaD

plugins are all inside your rails-project's directory. so moving that
would move your plugins with it. and to make sure you got all the gems
just list them ("gem list") and reinstall the same version on your new
machine.

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



[Rails] Re: may somebody can give me a detail steps about sqlite3 installation?

2009-03-21 Thread MaD

here you go:
http://mislav.uniqpath.com/rails/install-sqlite3/


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



[Rails] Migrating rails website from one server to another

2009-03-21 Thread Ank Ag

Hello,
 I have rails website running on one windows server. How can i migrate
the website from one server to another ensuring gems and plugins are
also migrated. both the servers run windoes 2003 and the database is
mssql 2000.
Thank you.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Problem running Rdoc from Rake in Rails 2.3

2009-03-21 Thread bornboulde...@gmail.com

People,

I'm getting an error from Rake I'd like to debug.  Here is a
screendump:


Fri Mar 20 23:28 /b/tmp/myfc23 maco$ rake doc:plugins:rspec
(in /b/tmp/myfc23)
rdoc -o doc/plugins/rspec --title 'Rspec Plugin Documentation' --line-
numbers --inline-source --charset utf-8 -T html vendor/plugins/rspec/
lib/autotest/discover.rb

major-snip


 95% [107/112]  vendor/plugins/rspec/lib/spec/runner/reporter.rb
vendor/plugins/rspec/lib/spec/runner/options.rb:217:52: Skipping
require of dynamic string: "spec/runner/heckle_runner#{suffix}"
100% [112/112]  vendor/plugins/rspec/lib/spec.rb

Generating Darkfish...
uh-oh! RDoc had a problem:
could not find template "html"

run with --debug for full backtrace
rake aborted!
Command failed with status (1): [rdoc -o doc/plugins/rspec --title
'Rspec P...]

(See full trace by running task with --trace)
Fri Mar 20 23:29 /b/tmp/myfc23 maco$

Here is some info about the rails I have installed:


Fri Mar 20 23:29 /b/tmp/myfc23 maco$ script/about
About your application's environment
Ruby version  1.8.7 (i686-darwin9.6.2)
RubyGems version  1.3.1
Rack version  1.0 bundled
Rails version 2.3.2
Active Record version 2.3.2
Action Pack version   2.3.2
Active Resource version   2.3.2
Action Mailer version 2.3.2
Active Support version2.3.2
Application root  /b/tmp/myfc23
Environment   development
Database adapter  sqlite3
Database schema version   0
Fri Mar 20 23:31 /b/tmp/myfc23 maco$


Here is a list of my gems:


Fri Mar 20 23:47 /b/tmp/myfc23 maco$
Fri Mar 20 23:47 /b/tmp/myfc23 maco$ gem list

*** LOCAL GEMS ***

actionmailer (2.3.2, 2.2.2)
actionpack (2.3.2, 2.2.2)
activerecord (2.3.2, 2.2.2)
activeresource (2.3.2, 2.2.2)
activesupport (2.3.2, 2.2.2)
cgi_multipart_eof_fix (2.5.0)
chronic (0.2.3)
columnize (0.3.0)
daemons (1.0.10)
darkfish-rdoc (1.1.5)
diff-lcs (1.1.2)
extlib (0.9.10)
fastthread (1.0.1)
gem_plugin (0.2.3)
highline (1.5.0)
hoe (1.9.0)
hpricot (0.6.164)
libxml-ruby (0.9.8)
linecache (0.43)
mongrel (1.1.5)
mysql (2.7)
newgem (1.2.3)
rack (0.9.1)
rails (2.3.2, 2.2.2)
rake (0.8.4, 0.8.3)
rcov (0.8.1.2.0)
rdoc (2.4.1)
RedCloth (4.1.9)
rhodes (0.3.0)
rspec (1.2.0, 1.1.12)
rspec-rails (1.2.0, 1.1.12)
rubigen (1.5.2)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
rubyforge (1.0.3)
sqlite3-ruby (1.2.4, 1.2.3)
syntax (1.0.0)
templater (0.5.0)
ZenTest (3.8.0)
Fri Mar 20 23:48 /b/tmp/myfc23 maco$

As you can see from the above list that my version of rake is 0.8.4
As you can see from the above list that my version of rdoc is 2.4.1
As you can see from the above list that my version of darkfish-rdoc is
1.1.5

The error:

Generating Darkfish...
uh-oh! RDoc had a problem:
could not find template "html"

Suggests to me that I am missing something simple...

-Bjorn


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