[Rails] Re: Is this book dated?

2010-07-06 Thread Marnen Laibow-Koser
Zoltan Gero wrote:
> About RadRails:
> 
> Why should I spend my time with syntax controlling, checking, if I
> should spend my time with the customer? I think it is agile attitude,
> right? :)

Any good editor does syntax highlighting and project viewing.  You don't 
need an IDE to get those features.
> 

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

Sent from my iPhone
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] How to Link between J2ME and rubyonrails

2010-07-06 Thread Raksha Prasad
We have a J2ME application that should upload a file (image) to our
rubyonrails server,
   where J2ME acts as client part and rubyonrails as server side.
   I wanted to know how to LINK the J2ME client side having rubyonrails
as server part.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] RubyonRails

2010-07-06 Thread Raksha Prasad
We have a J2ME application that should upload a file (image) to our
rubyonrails server,
   where J2ME acts as client part and rubyonrails as server side.
 I wanted to know how to LINK the J2ME client side having rubyonrails as
server part.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: mysql gem install not happening on Mac OS Leopard - any inputs at all??

2010-07-06 Thread Ram
Hello Marnen,

On the contrary, I find hivelogic's logic (:P) quite sound.

I understand that the possibility of software updates breaking the
environment is kinda remote, but learning to build from source and
knowing exactly where your software is helps a lot. Whats the point in
developing in RoR but having little knowledge of where your components
are installed on your machine or how to update them? I help maintain a
couple other Macs where we followed hivelogic's article the very day
the Macs were opened from their boxes, and they have no issues
whatsoever in maintenance. In contrast, my setup has been giving
trouble regularly. Still remains to be seen though, whether having
hivelogic's setup on top now on my machine will work consistently :).

Besides, gem install mysql simply dint work in my older setup. Spent
couple of weeks on it.

On Jul 7, 1:28 am, Marnen Laibow-Koser  wrote:
> Ram wrote:
> > Okay ... RESOLVED! :D
>
> > I left themysqlinstallation as such in /usr/local .
> > I had been running the ruby and rails shipped with leopard in /usr/
> > bin.
> > Followed the hivelogic article (http://hivelogic.com/articles/ruby-
> > rails-leopard) to roll my own installations in /usr/local/ and then
> > ran "sudogeminstallmysql-- --with-mysql-dir=/usr/local/mysql" .
> > Worked like a charm!
>
> Hivelogic's advice to roll your own Ruby installation is generally
> pointless and silly on Leopard (unless you're using 1.9).  Now that you
> have it all running, I suggest that you get it working with the system
> Ruby (which it *will* do) and delete the unnecessary Hivelogic one.
>
>
>
> > Thank you all for the help! :)
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://www.ruby-forum.com/.

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



[Rails] Re: Re: Newbie question - VirtualRails

2010-07-06 Thread Jerome Fillioux
jason white wrote:
> i've been using virtual rails for about 10 days, and it's been a easy 
> way to
> jump back into Rails development. Only thing that confused me in the
> beginning was the keyboard layout defaulted to French. no big deal, just 
> a
> few minutes of work. Otherwise it's a great setup, and I really 
> appreciate
> the work.
> 
> Jason

Hi Jason,

thank you for your comment, we're glad you appreciate VirtualRails !

the very next version will have the US keyboard layout as default :)

Jérôme Fillioux
VirtualRails team
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Is this book dated?

2010-07-06 Thread gezope
About RadRails:

Why should I spend my time with syntax controlling, checking, if I
should spend my time with the customer? I think it is agile attitude,
right? :)

I use RadRails as an Eclipse plugin (for free), and it helps a lot!
Mostly if you are not a real expert, many helpful features, text high-
lighting. Maybe basic stuff, but also terminal, project viewer
included, so I do not need to change the window 4 times if I change a
little chunk of code, or I do not miss to restart the server... Later
it will help me in refactoring, if I need, and many other little
stuff. It was a good choice I must say!

But: I also tried NetBeans, and its Rails plugin. The same, I think
that is also terrific! :)

Give them a try, these are free,
and never believe those, who wants to work too much! ;)
gezope

On júl. 6, 09:41, Angel Robert Marquez 
wrote:
> http://apress.com/book/view/9781590597811
>
> I acquired this book and it has the info I thought I wanted; but, I'm not
> sure.
>
> Is there something better more current out there? RESTful oath openid etc..
>
> I'm coming from a wordpress to cake, codeigniter tinkering and forget why I
> tried rails; but, it seems pretty cool and intuitive.
>
> Appreciate the Capistrano rec prior. Super good, like a dream come true. Was
> able to deploy wp with it.
>
> Also
>
> Would you all recommend aptana radRails?
>
> I'm using vim & gEdit..they seem fitting.
>
> Thoughts please.
>
> Thank you.

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



[Rails] Re: Is this book dated?

2010-07-06 Thread Marnen Laibow-Koser
Ginty wrote:
> Sorry but the advice to "don't use an IDE because Rails doesn't need
> one" is as dated as this book.

I try an IDE for Rails about once a year -- precisely so I don't get 
stuck on dated advice.  Inevitably, I go back to KomodoEdit.

I use NetBeans for JRuby/Monkeybars development.  I love it for that, 
but it is completely inappropriate for Rails work.

> 
> Today's IDEs give you significant advantages over a text editor, to
> name but a few:
> 
> Visual debugging.

Doesn't seem to work in NetBeans.

> No Rails configuration required, already understands the Rails
> structure for easy navigation.

That's one of the few things I miss about Aptana, but it's not a big 
enough advantage to put up with the rest.

> Integration with Rspec et al; run tests with a click, visual debug
> again, etc.

I run tests with *no* clicks (with autospec in the shell).  I don't need 
an IDE for that.

> Integration with Git; browse your changes, 1-click to diff, etc.

NetBeans' Git plugin is great (except for some annoying bugs), but 
except for the cute mouseover diffs, Komodo + GitX is at least as good a 
combination.

> 
> Netbeans is good I agree (plus has an awesome flawless Vim plugin),
> but I now use RubyMine which is better (although the Vim plugin
> blows), but it's not free though.

I won't pay for a text editor or an IDE.  There are so many good free 
tools that it seems silly.

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

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



[Rails] Re: Is this book dated?

2010-07-06 Thread gezope
I am currently reading this one:
http://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition
it helped me to build a webshop from totally 0! :)

But as someone else also suggested, the 4th edition coming soon:
http://www.pragprog.com/titles/rails4/agile-web-development-with-rails
(they wrote in October, and they won't be late I think!)

and it is about Rails 3! :)

It also helps me to get involved into this agile method. Also their
other books are similar in this point, for example using Github is
only 150 pages or like that, and extremely useful, alos for a beginner
like me, absolutely understandable!

Best wishes, hope you also share your opininon /advice what to read!
thx,
gezope

On júl. 6, 09:41, Angel Robert Marquez 
wrote:
> http://apress.com/book/view/9781590597811
>
> I acquired this book and it has the info I thought I wanted; but, I'm not
> sure.
>
> Is there something better more current out there? RESTful oath openid etc..
>
> I'm coming from a wordpress to cake, codeigniter tinkering and forget why I
> tried rails; but, it seems pretty cool and intuitive.
>
> Appreciate the Capistrano rec prior. Super good, like a dream come true. Was
> able to deploy wp with it.
>
> Also
>
> Would you all recommend aptana radRails?
>
> I'm using vim & gEdit..they seem fitting.
>
> Thoughts please.
>
> Thank you.

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



Re: [Rails] Re: Newbie question - VirtualRails

2010-07-06 Thread jason white
i've been using virtual rails for about 10 days, and it's been a easy way to
jump back into Rails development. Only thing that confused me in the
beginning was the keyboard layout defaulted to French. no big deal, just a
few minutes of work. Otherwise it's a great setup, and I really appreciate
the work.

Jason

On Tue, Jul 6, 2010 at 4:08 PM, Jerome Fillioux wrote:

> tinoD wrote:
> > Hi,
> >
> > Have been trying to set up Linux on my Windows machine, using
> > VirtualBox..
> >
> > Installed VirtualRails to give it a try as well..
> >
> > I did notice VR was using Rails version 2.3.4 rather than 2.3.5 (rails
> > -v gives 2.3.4) as specified on Some of VR's documentation (some
> > places mention rails 2.3.4 and some rails 2.3.5, like here:
> >
> http://groups.google.com/group/rubyonrails-talk/browse_frm/thread/9fcc04508132033d/d5e9a52f44764924?tvc=1#d5e9a52f44764924
> > )
> >
> > Have been trying to update to rails 2.3.5 using gem install and gem
> > update, specifying the version.. but so far didn't manage to do so..
> > I'm not sure how as well, being a complete newbie to Linux, and also
> > afraid to cause any damage.. was also afraid to update gems I do not
> > wish to update or to update rails to 2.3.8 while I wanted 2.3.5 and
> > don't feel confident I know how to change it back yet..
> >
> > Maybe it's not an issue and I should do with rails 2.3.4.. now I'm
> > also curious to know how and whether this should be done at all
> >
> > Any comments and replies will be very much appreciated :)
> >
> >
> > Thanks!
> >
> >
> > Best,
> > tino.
>
> Hi Tino,
>
> Thanks for using VirtualRails :)
> you're right, there was a mistake in our documentation, now the Rails
> version mentioned vor virtualrails 1.1 will be everywhere 2.3.4, and we
> will soon release a new version with rails 2.3.5 rails.
>
> with the actual 1.1 version, you can open a terminal and run the
> following command :
> sudo gem install rails --version 2.3.5
>
> it works just fine, and you will have the followinf output :
>
> virtualra...@jay ~ $ sudo gem install rails --version 2.3.5
> [sudo] password for virtualrails:
>
> Successfully installed activesupport-2.3.5
> Successfully installed activerecord-2.3.5
> Successfully installed actionpack-2.3.5
> Successfully installed actionmailer-2.3.5
> Successfully installed activeresource-2.3.5
> Successfully installed rails-2.3.5
> 6 gems installed
> Installing ri documentation for activesupport-2.3.5...
> Installing ri documentation for activerecord-2.3.5...
> Installing ri documentation for actionpack-2.3.5...
> Installing ri documentation for actionmailer-2.3.5...
> Installing ri documentation for activeresource-2.3.5...
> Installing ri documentation for rails-2.3.5...
> Installing RDoc documentation for activesupport-2.3.5...
> Installing RDoc documentation for activerecord-2.3.5...
> Installing RDoc documentation for actionpack-2.3.5...
> Installing RDoc documentation for actionmailer-2.3.5...
> Installing RDoc documentation for activeresource-2.3.5...
> Installing RDoc documentation for rails-2.3.5...
>
>
> hope it will help :)
> please feel free to send me support questions if you have troubles using
> VirtualRails !
>
> Jérôme Fillioux
> VirtualRails Team
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: Is this book dated?

2010-07-06 Thread Ginty
I agree the file browser side pane is nice.

If you like Vim and just want a side pane then go for Netbeans with
the Vim plugin:
http://jvi.sourceforge.net/

It works 100% like regular Vim, quite amazing how good it is actually.

On Jul 6, 9:37 pm, Angel Robert Marquez 
wrote:
> I don't know man. I used to work with these two dev guys that would debate
> constantly over cygwin and eclipse. Personally at the time (bout a year ago)
> I used both for whatever worked best for my understanding at the time. I do
> find myself leaning towards the command line more these days. The only
> reason I like gEdit opposed to vim is because of the file browser side pane.
> But, to each his own. I prefer IDEs like training wheels. They help me
> understand concepts more easily. The terminal with a semi transparent
> background is looking pretty slick and not very cluttered on F13. The only
> real problems I'm running into are compatibility issues and I don't think
> either the cl or the IDE would remedy those more favorably.
>
> i'll check out rubymine. I like looking at different UI designs for this
> stuff anyways and can use without marrying.
>
> danka!
>
> On Tue, Jul 6, 2010 at 7:22 PM, Ginty  wrote:
> > Sorry but the advice to "don't use an IDE because Rails doesn't need
> > one" is as dated as this book.
>
> > Today's IDEs give you significant advantages over a text editor, to
> > name but a few:
>
> > Visual debugging.
> > No Rails configuration required, already understands the Rails
> > structure for easy navigation.
> > Integration with Rspec et al; run tests with a click, visual debug
> > again, etc.
> > Integration with Git; browse your changes, 1-click to diff, etc.
>
> > Netbeans is good I agree (plus has an awesome flawless Vim plugin),
> > but I now use RubyMine which is better (although the Vim plugin
> > blows), but it's not free though.
>
> > On Jul 6, 7:16 pm, Marnen Laibow-Koser  wrote:
> > > Bb Serviss wrote:
> > > > I really liked "Simply Rails 2" by Patrick Lenz. It's the only rails
> > > > book where I went through all the code examples.
>
> > > I haven't read that book, but based on all the technical errors in
> > > another one of Patrick's Rails books (Building Your Own RoR Web
> > > Applications), I'd tend to steer well clear of any of his Rails writing.
>
> > > > As far as an IDE goes - I like Netbeans. You can code with a simple
> > > > editor but nothing beats the view Netbeans gives you.
>
> > > NetBeans is a great IDE, but I do not believe it offers any advantage at
> > > all for Rails development (I use it for other stuff).  What do you mean
> > > by "the view NetBeans gives you"?
>
> > > Best,
> > > --
> > > Marnen Laibow-Koserhttp://www.marnen.org
> > > mar...@marnen.org
>
> > > Sent from my iPhone
> > > --
> > > Posted viahttp://www.ruby-forum.com/.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Ruby on Rails: Talk" group.
> > To post to this group, send email to rubyonrails-t...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > rubyonrails-talk+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



Re: [Rails] Re: Is this book dated?

2010-07-06 Thread Angel Robert Marquez
I don't know man. I used to work with these two dev guys that would debate
constantly over cygwin and eclipse. Personally at the time (bout a year ago)
I used both for whatever worked best for my understanding at the time. I do
find myself leaning towards the command line more these days. The only
reason I like gEdit opposed to vim is because of the file browser side pane.
But, to each his own. I prefer IDEs like training wheels. They help me
understand concepts more easily. The terminal with a semi transparent
background is looking pretty slick and not very cluttered on F13. The only
real problems I'm running into are compatibility issues and I don't think
either the cl or the IDE would remedy those more favorably.

i'll check out rubymine. I like looking at different UI designs for this
stuff anyways and can use without marrying.

danka!

On Tue, Jul 6, 2010 at 7:22 PM, Ginty  wrote:

> Sorry but the advice to "don't use an IDE because Rails doesn't need
> one" is as dated as this book.
>
> Today's IDEs give you significant advantages over a text editor, to
> name but a few:
>
> Visual debugging.
> No Rails configuration required, already understands the Rails
> structure for easy navigation.
> Integration with Rspec et al; run tests with a click, visual debug
> again, etc.
> Integration with Git; browse your changes, 1-click to diff, etc.
>
> Netbeans is good I agree (plus has an awesome flawless Vim plugin),
> but I now use RubyMine which is better (although the Vim plugin
> blows), but it's not free though.
>
> On Jul 6, 7:16 pm, Marnen Laibow-Koser  wrote:
> > Bb Serviss wrote:
> > > I really liked "Simply Rails 2" by Patrick Lenz. It's the only rails
> > > book where I went through all the code examples.
> >
> > I haven't read that book, but based on all the technical errors in
> > another one of Patrick's Rails books (Building Your Own RoR Web
> > Applications), I'd tend to steer well clear of any of his Rails writing.
> >
> >
> >
> > > As far as an IDE goes - I like Netbeans. You can code with a simple
> > > editor but nothing beats the view Netbeans gives you.
> >
> > NetBeans is a great IDE, but I do not believe it offers any advantage at
> > all for Rails development (I use it for other stuff).  What do you mean
> > by "the view NetBeans gives you"?
> >
> > Best,
> > --
> > Marnen Laibow-Koserhttp://www.marnen.org
> > mar...@marnen.org
> >
> > Sent from my iPhone
> > --
> > Posted viahttp://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: Is this book dated?

2010-07-06 Thread Ginty
Sorry but the advice to "don't use an IDE because Rails doesn't need
one" is as dated as this book.

Today's IDEs give you significant advantages over a text editor, to
name but a few:

Visual debugging.
No Rails configuration required, already understands the Rails
structure for easy navigation.
Integration with Rspec et al; run tests with a click, visual debug
again, etc.
Integration with Git; browse your changes, 1-click to diff, etc.

Netbeans is good I agree (plus has an awesome flawless Vim plugin),
but I now use RubyMine which is better (although the Vim plugin
blows), but it's not free though.

On Jul 6, 7:16 pm, Marnen Laibow-Koser  wrote:
> Bb Serviss wrote:
> > I really liked "Simply Rails 2" by Patrick Lenz. It's the only rails
> > book where I went through all the code examples.
>
> I haven't read that book, but based on all the technical errors in
> another one of Patrick's Rails books (Building Your Own RoR Web
> Applications), I'd tend to steer well clear of any of his Rails writing.
>
>
>
> > As far as an IDE goes - I like Netbeans. You can code with a simple
> > editor but nothing beats the view Netbeans gives you.
>
> NetBeans is a great IDE, but I do not believe it offers any advantage at
> all for Rails development (I use it for other stuff).  What do you mean
> by "the view NetBeans gives you"?
>
> Best,
> -- 
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
>
> Sent from my iPhone
> --
> Posted viahttp://www.ruby-forum.com/.

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



Re: [Rails] Help - Google Charts on Rails Plugin

2010-07-06 Thread Juliana Cindra
Sorry, I'll explain it better.

Well, I'm starting in rails now and was testing some things with plugins. I
wanted to create some graphs in my plugin to generate reports using the
google charts to show the data that was saved in the db. I was not able to
generate the chart, but I managed to run one of an example. Only now I have
a new problem, my plugin needs to access a data class from another plugin so
I can take the data bank, but when I try to see if they sought the data only
appears so: #.

For example: @dados = Resposta.find(:all, :conditions => ["nota = ? AND
pergunta_id = ?", "1", "2"])

This class 'Resposta' is another plugin, how do you get these figures in my
class the plugin I'm doing? I need them so I can use in my chart.

Since already many thanks to all!



Me desculpe, vou me explicar melhor.

Bom, eu estou iniciando no rails agora e estava testando algumas coisas com
plugins. Eu queria criar uns gráficos no meu plugin de geração de relatórios
usando o google charts pra mostrar os dados que foram salvos no banco. Eu
não estava conseguindo gerar gráfico, mas consegui rodar um de um exemplo.
Só que agora estou com um novo problema, meu plugin precisa acessar uns
dados de classe de outro plugin pra poder pegar os dados do banco, mas
quando eu tento ver se buscou os dados só aparece isso:  # .

Por exemplo: @dados = Resposta.find(:all, :conditions => ["nota = ? AND
pergunta_id = ?", "1", "2"]).

Esta classe 'Resposta' é de outro plugin, como faço pra obter estes dados na
minha classe do plugin que estou fazendo? Preciso deles pra poder usar no
meu gráfico.

Desde já muito obrigada a todos!

= Juliana Cindra =



2010/7/6 Bill Walton 

> Hi Juliana,
>
> On Mon, Jul 5, 2010 at 4:48 PM, Juliana Cindra  wrote:
> > I'm starting at the RR, and I'm trying to use google charts to generate
> some
> > graphs in a single plugin in rails. But I'm testing the samples that are
> > giving errors. I think it must be configuration error. Someone who has
> used
> > google charts on rails help me?
>
> You'll need to provide more information in order to get help.  What
> plugin are you using?  Show a small example of how you're using it,
> and the error that you're getting.
>
> Best regards,
> Bill
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: Looking for some input on career advancement w/ Rails

2010-07-06 Thread Matt Jones


On Jul 6, 1:46 am, Phoenix Rising  wrote:
>
> Finally, regarding management.  Has anyone else felt like there's an
> invisible barrier that people just will never give them a chance to be
> in a leadership or management position?  Every organization I've been
> in, this has been a problem for me - zero room for career
> advancement.  Maybe it's just me - I'm fully willing to accept that as
> a reality.  However, I suspect that it's more a "management" ideal
> where they don't want good "nerds" becoming managers because they have
> to replace those "nerds".  I don't mean this in a derogatory sense,
> but I think some typical "management" people do.  Does anyone else get
> this impression, or am I just full of it?  And does anyone have any
> tips on how I might be able to transition out of development at the
> company I currently work for, and into a management role at another
> company?  What kind of job titles or descriptions should I be looking
> for?  I've looked for things such as "web manager" or "development
> manager", "development director", etc., but those types of jobs seem
> to be few and far between.

Note that, depending on the company organization, a title like
"project manager" may not actually be a vertical promotion from
"developer". At the company I work at (a digital services wing of an
adverstising / PR business), project managers are the principal
liaison to clients and handle a lot of the tedious parts - collecting
requirements, chasing down documents, tracking deadlines, triaging
incoming "OMG THE SITE IS DOWN" calls, etc. However, as a developer, I
don't "belong" to a particular PM and work with several depending on
load and client needs.

You may also want to expand your search beyond "Rails-only" shops;
there's an awful lot of places that are carrying around legacy PHP,
etc. systems but want to develop with the "new hotness" for new work.
Being somebody who can handle dealing with both would seem to be a
significant advantage.

BTW: if you were in Ohio, I'd be wanting your resume. We're currently
looking to hire a developer with (mostly) PHP and a little Rails
background. A certain bank whose name is a verb starting with C has
seriously depleted the local Rails pool... :)

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



Re: [Rails] Re: Is this book dated?

2010-07-06 Thread Angel Robert Marquez
i'

On Tue, Jul 6, 2010 at 5:16 PM, Marnen Laibow-Koser wrote:

> Bb Serviss wrote:
> > I really liked "Simply Rails 2" by Patrick Lenz. It's the only rails
> > book where I went through all the code examples.
>
> I haven't read that book, but based on all the technical errors in
> another one of Patrick's Rails books (Building Your Own RoR Web
> Applications), I'd tend to steer well clear of any of his Rails writing.
> >
> > As far as an IDE goes - I like Netbeans. You can code with a simple
> > editor but nothing beats the view Netbeans gives you.
>
> NetBeans is a great IDE, but I do not believe it offers any advantage at
> all for Rails development (I use it for other stuff).  What do you mean
> by "the view NetBeans gives you"?
>
> Best,
> --
> Marnen Laibow-Koser
> http://www.marnen.org
> mar...@marnen.org
>
> Sent from my iPhone
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: Is this book dated?

2010-07-06 Thread Marnen Laibow-Koser
Bb Serviss wrote:
> I really liked "Simply Rails 2" by Patrick Lenz. It's the only rails
> book where I went through all the code examples.

I haven't read that book, but based on all the technical errors in 
another one of Patrick's Rails books (Building Your Own RoR Web 
Applications), I'd tend to steer well clear of any of his Rails writing.
> 
> As far as an IDE goes - I like Netbeans. You can code with a simple
> editor but nothing beats the view Netbeans gives you.

NetBeans is a great IDE, but I do not believe it offers any advantage at 
all for Rails development (I use it for other stuff).  What do you mean 
by "the view NetBeans gives you"?

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

Sent from my iPhone
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: How can I hide my Ruby code?

2010-07-06 Thread Matt Jones


On Jul 6, 6:19 am, Andy Jeffries  wrote:
> On 6 July 2010 10:34, Sumanta Das  wrote:
>
> > Or if there is any way so that I can encrypt my code
> > without interrupting the execution of the application.
>
> You can do this (I've had to do it for a client) but it's not simple and I
> can't share my solution's code.  However, you basically go along the lines
> that you have a class responsible for decrypting/encrypting code (I used
> Base64 encoded AES).  You then have Rake tasks that go through all Ruby (I
> did YAML too as YAML files are executed as ERB first) files, encrypt the
> content and replace the file contents with contents like this:
>
> require 'config_decryptor'
> eval ConfigDecryptor.decrypt(...ENCRYPTED_CONTENT_HERE...)
>
> Your config_decryptor.rb file has to be in the load path - I handled this by
> requiring the full path in a config/preinitializer.rb file.
>
> The eval is done once as the Ruby class files are cached in memory during
> production mode.
>
> The next problem is getting the key in to Ruby.  I did this by having a Rake
> task that puts it in to a specific named file in /tmp which is then read by
> my class (during a call in preinitializer.rb) and deleted.  It's not ideal,
> but it works for my purpose and would also work for yours.
>
> The last step, if you're using Passenger ensure that the last child is never
> killed off (if it is, it will lose the decryption key which is now only in
> memory).  I can't remember the setting but there's a timeout setting which
> you can set to zero so the last child never dies.
>

Interesting solution, but also not secure. Anybody who has root can
read out your running processes' memory spaces and either (a) grab the
key and yer pwned or (b) grab the bytecodes, decompile and yer pwned.

Add to that bonus nasties like directly frobbing the core of a running
VPS instance from the hypervisor, and you're back in security hell
again.

BTW, .Net code is similarly not "secure", since you're handing over
binaries with the setup program.

The real question is not "is the code 100% secure" - it's physically
impossible for that to be the case unless the server itself is somehow
locked up, etc etc etc. The real question is, "is the code worth
stealing"? If it is, then the best protection to invest in is the
oldest: LAWYERS. The reason that (for instance) stolen copies of the
Windows source aren't available has nothing to do with l33t security
on the code repository, but rather the army of rabid lawyers bound to
descend on anyone that posts it. If your code is worth stealing, then
it's worth getting an effective license drawn up - and worth
*pursuing* that license in court should it be broken.

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



[Rails] Re: Re: before_filter question

2010-07-06 Thread Bob Proulx
Ralph Shnelvar wrote:
> Marnen Laibow-Koser wrote:
> > That said, if you have a controller method (such as Ralph's 
> > fetch_logged_user) that is not meant to be called as an action, it is an 
> > extremely good idea to make it non-public (that is, private or 
> > protected) so that it cannot be called as an action accidentally (or 
> > maliciously).
> 
> Ok ... that sent up alarm bells.
> 
> So ... how can I prevent Rails from calling, say,
>  def fetch_logged_user
># black blah blah
>  end
> or
>  def is_logged_in_user?
>!...@logged_user.nil?
>  end
> and yet allow all other controllers access to those two functions?

As Marnen said, make it private or protected.  Like this:

   protected
 def fetch_logged_user
   ...
 end

Bob

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



[Rails] Re: Is this book dated?

2010-07-06 Thread Agoofin
I really liked "Simply Rails 2" by Patrick Lenz. It's the only rails
book where I went through all the code examples.

As far as an IDE goes - I like Netbeans. You can code with a simple
editor but nothing beats the view Netbeans gives you.



On Jul 6, 4:11 pm, Marnen Laibow-Koser  wrote:
> Angel Marquez wrote:
>
> [...]
>
> > Would you all recommend aptana radRails?
>
> No.  Rails doesn't benefit from the use of an IDE.  Just use a good text
> editor.
>
>
>
> > I'm using vim & gEdit..they seem fitting.
>
> Yeah, that may be better.  Personally, I'm fond of KomodoEdit.
>
>
>
> > Thoughts please.
>
> > Thank you.
>
> 
> You are using test-first development and version control, right?
> 
>
> Best,
> --
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
> --
> Posted viahttp://www.ruby-forum.com/.

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



[Rails] Re: Re: before_filter question

2010-07-06 Thread Ralph Shnelvar
Marnen Laibow-Koser wrote:
> 
> That said, if you have a controller method (such as Ralph's 
> fetch_logged_user) that is not meant to be called as an action, it is an 
> extremely good idea to make it non-public (that is, private or 
> protected) so that it cannot be called as an action accidentally (or 
> maliciously).

Ok ... that sent up alarm bells.

So ... how can I prevent Rails from calling, say,
 def fetch_logged_user
   # black blah blah
 end
or
 def is_logged_in_user?
   !...@logged_user.nil?
 end
and yet allow all other controllers access to those two functions?
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Sessions and authorization

2010-07-06 Thread Ralph Shnelvar
Bob Proulx wrote:

> 
> Here is a good guide for further information.
> 
>   http://guides.rubyonrails.org/security.html
> 
> Bob


I must have read that guide over the last sdevera; months a half a dozen 
times.

Your two-paragraph explanation made it snap into focus for me  
finally!

Thanks!

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

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



[Rails] Re: Re: before_filter question

2010-07-06 Thread Marnen Laibow-Koser
Marnen Laibow-Koser wrote:
> Colin Law wrote:
>> On 6 July 2010 21:38, Marnen Laibow-Koser  wrote:
>>> �end
>>> end
>>>
>>> then (unless I'm badly mistaken) you can get to the write_shakespeare
>>> method by (say) calling
>>>
>>> redirect_to :controller => 'plays', :action => 'write_shakespeare'
>>>
>>> regardless of what's in your routes file. �There may not be a direct URL
>>> to that action, but that doesn't prevent it from being an action.
>> 
>> In fact would it be true to say that no method of a controller is
>> inherently an action or not an action?  
> 
> No.  In  Rails, every public controller method is, by definition, an 
> action.  Period.  That's all.

OK, I now have to modify my answer.  With Ralph's latest question, I see 
what you're getting at.  So, here's the modified answer:

In Rails, every public controller method can, by definition, *behave as* 
an action -- that is, it can be called with suitable use of render 
:controller, :action.  It can also be called with a regular Ruby-style 
method call, in which case it does not behave as an action.

Whether a public controller method behaves as an action depends not on 
the method itself but on how it's called.

That said, if you have a controller method (such as Ralph's 
fetch_logged_user) that is not meant to be called as an action, it is an 
extremely good idea to make it non-public (that is, private or 
protected) so that it cannot be called as an action accidentally (or 
maliciously).

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

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

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



[Rails] Re: View Path and Plugins

2010-07-06 Thread Marnen Laibow-Koser
Greg Willits wrote:
> I have a plugin. I want to include some baseline views for the app code
> to "just use" -- meaning no need to copy files into /app, and no need to
> specify a path in the controller.
> 
> Is that possible? If I *have* to add something to the controller, that's
> fine. The more important need is to have files reside in the plugin
> folder.

ActiveScaffold does this.  You might want to take a look at their 
implementation.  If I remember, view_path is involved.

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

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



[Rails] Re: before_filter question

2010-07-06 Thread Marnen Laibow-Koser
Ralph Shnelvar wrote:
[...]
> What prevents infinite recursion?

What would cause infinite recursion?

> 
> 
> - - - - -
> class ApplicationController < ActionController::Base
>   before_filter:fetch_logged_user
>   before_filter:authenticate,  :except => :login
> 
> # Filters added to this controller apply to all controllers in the 
> application.
> # Likewise, all the methods added will be available for all controllers.
> 
> class ApplicationController < ActionController::Base
>   before_filter:fetch_logged_user
>   before_filter:authenticate,  :except => :login
> 
>   helper :all # include all helpers, all the time
>   protect_from_forgery
> 
> 
>   def fetch_logged_user
> unless session[:user_id].blank?
>   @logged_user = User.find(session[:user_id])
> end
> 
>   rescue ActiveRecord::RecordNotFound
>   end
> 
> 
>   def is_logged_in_user?
> !...@logged_user.nil?
>   end
> 
> protected
>   def authenticate
> debugger
> unless @logged_user
>   #unauthorized access
>   redirect_to :controller => :welcome, :status => 401
>   return false
> end
>   end
> end
> 
> 
> 
> class ExplanationController < ApplicationController
>   def whatIsThisGameAbout

Hey!  Watch the camelCase!  That should be what_is_this_game_about .
Actually, it should probably game_info or something.

> x = is_logged_in_user?
> debugger
> x
>   end
> 
> 
> protected
>   def authenticate
> debugger
> x=1
>   end
> 
> end
> - - - - -
> 
> 
> I am pretty sure that when Rails calls the action whatIsThisGameAbout 
> that when is_logged_in_user? is invoked that the before_filters are NOT 
> invoked again before is_logged_in_user? is invoked.

You're quite right.  When you do a straight method call, the filter 
chain is not invoked -- after all, it's just a straight method call, and 
it works just like it does anywhere else in Ruby.  It's only invoked 
when you call a controller method *as an action* -- that is, when you go 
through the whole Rails stack, as with a Web request or with render 
:controller, :action -- that the filter chain is invoked.

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

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



[Rails] Re: before_filter question

2010-07-06 Thread Ralph Shnelvar
Marnen Laibow-Koser wrote:
> Ralph Shnelvar wrote:
> [...]
>> Here's another question:
>> Is the before_filter ever called before methods in 
>> ApplicationController?
> 
> Yes. (Try it and find out!)  Most authentication libraries work this 
> way.  Doesn't Devise?
> 
> Best,
> -- 
> Marnen Laibow-Koser
> http://www.marnen.org
> mar...@marnen.org
> 
> Sent from my iPhone

What prevents infinite recursion?


- - - - -
class ApplicationController < ActionController::Base
  before_filter:fetch_logged_user
  before_filter:authenticate,  :except => :login

# Filters added to this controller apply to all controllers in the 
application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  before_filter:fetch_logged_user
  before_filter:authenticate,  :except => :login

  helper :all # include all helpers, all the time
  protect_from_forgery


  def fetch_logged_user
unless session[:user_id].blank?
  @logged_user = User.find(session[:user_id])
end

  rescue ActiveRecord::RecordNotFound
  end


  def is_logged_in_user?
!...@logged_user.nil?
  end

protected
  def authenticate
debugger
unless @logged_user
  #unauthorized access
  redirect_to :controller => :welcome, :status => 401
  return false
end
  end
end



class ExplanationController < ApplicationController
  def whatIsThisGameAbout
x = is_logged_in_user?
debugger
x
  end


protected
  def authenticate
debugger
x=1
  end

end
- - - - -


I am pretty sure that when Rails calls the action whatIsThisGameAbout 
that when is_logged_in_user? is invoked that the before_filters are NOT 
invoked again before is_logged_in_user? is invoked.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Sessions and authorization

2010-07-06 Thread Bob Proulx
Ralph Shnelvar wrote:
> The line that concerns me is
> session[:user_id] = user.id
> ...
> Given that the session data is likely to be stored in cookies, and given
> that user.id is likely to be a relatively small number (less than a
> million) ... how secure is this as a flag to indicate that someone is an
> authorized user of a store???  Couldn't an unauthorized user create the
> session[:user_id] = user.id and then get access?

A good question!  You are thinking the right way.  Fortunately this
question has been asked already and the answer is that the session is
a signed piece of data using an HMAC.  This means that if an attacker
tries to change the values in the session store that the signature
will fail.  The signature check in Rails will catch this and the user
will see a 422 error.  Try it!

Note that the session is only signed and not encrypted.  So don't
store anything there that you don't want the user to be able to see.
It is only protected from modification and not protected from being
seen.

Here is a good guide for further information.

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

Bob

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



[Rails] Re: how to make confirm boxes conditional?

2010-07-06 Thread Bob Proulx
Lille wrote:
> Actually, the matter is simpler than either of us seemed to
> anticipate: the :confirm helper option just isn't very helpful. In
> other words, all :confirm=>'Are you sure?' does is produce the raw
> html onclick=>"return confirm('Are you sure?')". I had assumed that if
> it were a helper, I should want to use it, not duplicate it, ergo my
> post.
> 
> So, if anyone ever wants to make conditional the :confirm option of
> the link_to/button_to erb function, use :onclick=>"if(...)
> { confirm('whatever text');}" -- involving whatever conditional logic
> you like in the raw javascript.

And what are your plans if the user's browser isn't running
Javascript?  Because in that case they won't ever see your
confirmation.  Progressive Enhancement is better than Graceful
Degradation.

Bob

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



[Rails] Sessions and authorization

2010-07-06 Thread Ralph Shnelvar
I'm looking at page 162 in *Agile Web Development with Rails* and in
there they do the following once they find that a user has logged in
with the right name and password:

- - -
  def login
if request.post?
  user = User.authenticate(params[:username], params[:password])
  if user
session[:user_id] = user.id
redirect_to(:action => "index")
  else
flash.now[:notice] = "Invalid user/password combination"
  end
end
  end
- - -

The line that concerns me is
session[:user_id] = user.id

The authors write
#
The logni action will need to record something in session to say that an
administrator is logged in.  Let's have it store the id of their User
object using the hey user.id.   The login code looks like this:
#

Given that the session data is likely to be stored in cookies, and given
that user.id is likely to be a relatively small number (less than a
million) ... how secure is this as a flag to indicate that someone is an
authorized user of a store???  Couldn't an unauthorized user create the
session[:user_id] = user.id and then get access?
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Helper in Initializer: Is it possible ?

2010-07-06 Thread Bob Proulx
Tom Ha wrote:
> The .pdf must display numbers in a special format. And until now, I
> used helper code to get the numbers into this format, so it would
> have been convenient to use the same helper within this Rufus
> scheduler initializer..

To my casual eye this seems like something that should go in as a
routine a library file and that routine should be called both in your
helper and in your initializer.  It just needs a small amount of
refactoring as your needs have changed.

Bob

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



[Rails] View Path and Plugins

2010-07-06 Thread Greg Willits
I have a plugin. I want to include some baseline views for the app code
to "just use" -- meaning no need to copy files into /app, and no need to
specify a path in the controller.

Is that possible? If I *have* to add something to the controller, that's
fine. The more important need is to have files reside in the plugin
folder.

I've googled and played with various blog tips, but nothing is working
the way I am wanting. This is not a case of applying skins or themes. I
just want a set of default files to be available to the app.

The closest thing I found was this post, but it doesn't work.

http://weblog.rubyonrails.org/2007/2/4/new-feature-for-rails-2-0-multiple-controller-view-paths

The key piece that confuses me is the line
ActionController::Base.view_paths.unshift File.join(directory, 'views')
-- it's not clear where "directory" is being defined.

I tried this with no joy:

plugin_folder = "#{File.dirname(__FILE__)}"
ActionController::Base.view_paths.unshift File.join(plugin_folder,
'views')

I must be missing something, because the above blog post seems like this
should be fairly simple.

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

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



[Rails] Re: Re: before_filter question

2010-07-06 Thread Marnen Laibow-Koser
Colin Law wrote:
> On 6 July 2010 21:38, Marnen Laibow-Koser  wrote:
>> �end
>> end
>>
>> then (unless I'm badly mistaken) you can get to the write_shakespeare
>> method by (say) calling
>>
>> redirect_to :controller => 'plays', :action => 'write_shakespeare'
>>
>> regardless of what's in your routes file. �There may not be a direct URL
>> to that action, but that doesn't prevent it from being an action.
> 
> In fact would it be true to say that no method of a controller is
> inherently an action or not an action?  

No.  In  Rails, every public controller method is, by definition, an 
action.  Period.  That's all.


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

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



[Rails] Re: before_filter question

2010-07-06 Thread Marnen Laibow-Koser
Ralph Shnelvar wrote:
[...]
> Here's another question:
> Is the before_filter ever called before methods in 
> ApplicationController?

Yes. (Try it and find out!)  Most authentication libraries work this 
way.  Doesn't Devise?

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

Sent from my iPhone

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

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



Re: [Rails] Re: before_filter question

2010-07-06 Thread Colin Law
On 6 July 2010 21:38, Marnen Laibow-Koser  wrote:
> Jeff Cohen wrote:
> [...]
>> Good question.  Methods in controllers are considered actions only if
>> they're connected to a url.
>
> That's not true at all.  For example, if you have
>
> class PlaysController < ApplicationController
>  def write_shakespeare
>  ...
>  end
> end
>
> then (unless I'm badly mistaken) you can get to the write_shakespeare
> method by (say) calling
>
> redirect_to :controller => 'plays', :action => 'write_shakespeare'
>
> regardless of what's in your routes file.  There may not be a direct URL
> to that action, but that doesn't prevent it from being an action.

In fact would it be true to say that no method of a controller is
inherently an action or not an action?  An action is a verb not a noun
so it is not correct to say that a method is or is not an action.   An
action (initiated via a url or redirect_to for example) results in
calling a method of a controller and it is under these circumstances
that the filters are called.  Calling a method directly from code will
not result in filters being called.

Colin

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



[Rails] Polymorphic abstraction of Models, design help needed

2010-07-06 Thread ayanb
We have Models like Supplier, Distributor, Vendor, Buyer in our
schema. These entities have some common attributes ( like name,
description, sales offices etc.) but mostly they have a divergent
schema with different has_many :through associations ( a vendor has
many stock_keeping_units , others do not) because of which they needed
to be collapsed to separate models.

We also have various types of Events in the system, for example, a
partnership event, a distributorship event, a procurement event, etc.

How can I create a is_a relationship and abstract these buyer, vendor,
etc models to a Company Model and when creating an event , like say a
partnership event, simply say Company 1 partnered with Company 2
without worrying what the company type is, so that I can do something
like this on my form partial for an Event Submission:

  
<%= f.label "Company 1" %>
<%= f.collection_select :partnering_company_id_1,
Company.all ,:id, :name, { :default => true} %>
  

I am willing to share more details of the schema in case its needed.
Is this possible? I recently came across this blog post (http://
mediumexposure.com/multiple-table-inheritance-active-record/) which
goes ahead and describes some smart Mutiple Table Inheritance but I am
not sure if this is applicable to the current problem statement.

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



[Rails] Re: before_filter question

2010-07-06 Thread Ralph Shnelvar
Marnen Laibow-Koser wrote:
> Ralph Shnelvar wrote:
>> If one places a before_filter in class ApplicationController, when is
>> the before filter called and for which methods.
> 
> Does 
> http://www.railsapi.com/doc/rails-v2.3.8/classes/ActionController/Filters/ClassMethods.html
>  
> answer your question?

It certainly helps but it did not address my question directly.

Here's another question:
Is the before_filter ever called before methods in 
ApplicationController?
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Newbie question - VirtualRails

2010-07-06 Thread Jerome Fillioux
tinoD wrote:
> Hi,
> 
> Have been trying to set up Linux on my Windows machine, using
> VirtualBox..
> 
> Installed VirtualRails to give it a try as well..
> 
> I did notice VR was using Rails version 2.3.4 rather than 2.3.5 (rails
> -v gives 2.3.4) as specified on Some of VR's documentation (some
> places mention rails 2.3.4 and some rails 2.3.5, like here:
> http://groups.google.com/group/rubyonrails-talk/browse_frm/thread/9fcc04508132033d/d5e9a52f44764924?tvc=1#d5e9a52f44764924
> )
> 
> Have been trying to update to rails 2.3.5 using gem install and gem
> update, specifying the version.. but so far didn't manage to do so..
> I'm not sure how as well, being a complete newbie to Linux, and also
> afraid to cause any damage.. was also afraid to update gems I do not
> wish to update or to update rails to 2.3.8 while I wanted 2.3.5 and
> don't feel confident I know how to change it back yet..
> 
> Maybe it's not an issue and I should do with rails 2.3.4.. now I'm
> also curious to know how and whether this should be done at all
> 
> Any comments and replies will be very much appreciated :)
> 
> 
> Thanks!
> 
> 
> Best,
> tino.

Hi Tino,

Thanks for using VirtualRails :)
you're right, there was a mistake in our documentation, now the Rails 
version mentioned vor virtualrails 1.1 will be everywhere 2.3.4, and we 
will soon release a new version with rails 2.3.5 rails.

with the actual 1.1 version, you can open a terminal and run the 
following command :
sudo gem install rails --version 2.3.5

it works just fine, and you will have the followinf output :

virtualra...@jay ~ $ sudo gem install rails --version 2.3.5
[sudo] password for virtualrails:

Successfully installed activesupport-2.3.5
Successfully installed activerecord-2.3.5
Successfully installed actionpack-2.3.5
Successfully installed actionmailer-2.3.5
Successfully installed activeresource-2.3.5
Successfully installed rails-2.3.5
6 gems installed
Installing ri documentation for activesupport-2.3.5...
Installing ri documentation for activerecord-2.3.5...
Installing ri documentation for actionpack-2.3.5...
Installing ri documentation for actionmailer-2.3.5...
Installing ri documentation for activeresource-2.3.5...
Installing ri documentation for rails-2.3.5...
Installing RDoc documentation for activesupport-2.3.5...
Installing RDoc documentation for activerecord-2.3.5...
Installing RDoc documentation for actionpack-2.3.5...
Installing RDoc documentation for actionmailer-2.3.5...
Installing RDoc documentation for activeresource-2.3.5...
Installing RDoc documentation for rails-2.3.5...


hope it will help :)
please feel free to send me support questions if you have troubles using 
VirtualRails !

Jérôme Fillioux
VirtualRails Team
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: before_filter question

2010-07-06 Thread Marnen Laibow-Koser
Jeff Cohen wrote:
[...]
> Good question.  Methods in controllers are considered actions only if
> they're connected to a url.

That's not true at all.  For example, if you have

class PlaysController < ApplicationController
  def write_shakespeare
  ...
  end
end

then (unless I'm badly mistaken) you can get to the write_shakespeare 
method by (say) calling

redirect_to :controller => 'plays', :action => 'write_shakespeare'

regardless of what's in your routes file.  There may not be a direct URL 
to that action, but that doesn't prevent it from being an action.

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

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



[Rails] Re: before_filter question

2010-07-06 Thread Jeff
On Jul 6, 3:10 pm, Ralph Shnelvar  wrote:
> If one places a before_filter in class ApplicationController, when is
> the before filter called and for which methods.
>
> I believe it gets called before any "action" ... but how does rails know
> that the method is an action?
> --
> Posted viahttp://www.ruby-forum.com/.

Hi Ralph,

Good question.  Methods in controllers are considered actions only if
they're connected to a url.  Urls are connected to controller methods
by using routes.  The routes.rb file lists all of the routes that will
connect urls to controllers and actions.

In your routes, when you use map.connect (in Rails 1.x, 2.x) you
directly connect a url to an action method.  In Rails 3.0, this is
done with match() instead of connect, but the idea is the same.

If you use map.resources then you're connecting a whole slew of urls
to a certain actions in your controller.  Check the docs for details,
but this is the "restful" style of URL handling, and means that these
methods in your controller will become actions:

index
new
create
edit
update
show
destroy

Finally, be warned that in Rails 1.x and 2.x, when you generate a new
Rails app, by default a pattern-match connector is written for you,
exposing ALL of your methods as actions, which is probably not what
you want.  You should remove or comment those out.

Jeff

purpleworkshops.com

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



[Rails] Re: mysql gem install not happening on Mac OS Leopard - any inputs at all??

2010-07-06 Thread Marnen Laibow-Koser
Ram wrote:
> Okay ... RESOLVED! :D
> 
> I left the mysql installation as such in /usr/local .
> I had been running the ruby and rails shipped with leopard in /usr/
> bin.
> Followed the hivelogic article (http://hivelogic.com/articles/ruby-
> rails-leopard) to roll my own installations in /usr/local/ and then
> ran "sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql" .
> Worked like a charm!

Hivelogic's advice to roll your own Ruby installation is generally 
pointless and silly on Leopard (unless you're using 1.9).  Now that you 
have it all running, I suggest that you get it working with the system 
Ruby (which it *will* do) and delete the unnecessary Hivelogic one.

> 
> Thank you all for the help! :)

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

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



[Rails] Re: how to create virtual domain name for RoR application?

2010-07-06 Thread Marnen Laibow-Koser
Norm Scherer wrote:
> 
> 
> 
>http-equiv="Content-Type">
> 

[Please stop sending HTML e-mail to the list.]

[...]
> Or for a very
> small setup where you may not have a dns server (like in my den) I just
> put entries in /etc/hosts on all of the systems. 

No! Do it right: set up DNS entries on your router/hub/switch/whatever 
you connect to.

> It helps to
> configure your dhcp server (if you use one) to use fixed addresses for
> the server machine.

Indeed.

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

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



[Rails] Re: using ajax in nested attributes form

2010-07-06 Thread Marnen Laibow-Koser
Mlle wrote:
> How can I use ajax to add nested attributes dynamically into the form
> of an object?
> 
> I followed the railscast : 
> http://railscasts.com/episodes/74-complex-forms-part-2
> 
> but I'd like to use Ajax instead because the method above is sort of
> ugly.

No, actually, you don't want to use Ajax here.  That will mean a round 
trip to the server each time you want to add a field.  Bad idea.  This 
should all be done on the client side.

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

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



[Rails] Re: before_filter question

2010-07-06 Thread Marnen Laibow-Koser
Ralph Shnelvar wrote:
> If one places a before_filter in class ApplicationController, when is
> the before filter called and for which methods.

Does 
http://www.railsapi.com/doc/rails-v2.3.8/classes/ActionController/Filters/ClassMethods.html
 
answer your question?

> 
> 
> I believe it gets called before any "action" ... but how does rails know
> that the method is an action?

All (public) controller methods are in principle actions in Rails.  If 
you have ones that aren't, get them out of the controller or make them 
private.

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

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



[Rails] Re: SOAP web service

2010-07-06 Thread Marnen Laibow-Koser
Robert Walker wrote:
> codefusurfer wrote:
>> I am looking for a way to host a SOAP Webserver that serves the data
>> as SOAP document/literal. I know actionwebservice support SOAP RPC/
>> encoded mode but I need document/literal. Anyone knows how to do this?
> 
> The Java and .Net worlds have lots of "nice" options for those seeking 
> to torture themselves with SOAP web services. Ruby on Rails is VERY 
> opinionated against SOAP in favor of REST, as am I.
> 
> I'm sure it can be done, but you'd likely be better off finding a forum 
> devoted to providing SOAP with Ruby. I have a feeling you won't find 
> much assistance here. I could be wrong though.

I think you're right.  Does it absolutely have to be SOAP?  If not, your 
life will be easier.

If it does have to be SOAP, though, I believe there are some plugins and 
gems that could help.  I've never done this myself, but a Web search 
should send you in the right direction.

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

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



[Rails] Re: Is this book dated?

2010-07-06 Thread Marnen Laibow-Koser
Angel Marquez wrote:
[...]
> Would you all recommend aptana radRails?

No.  Rails doesn't benefit from the use of an IDE.  Just use a good text 
editor.

> 
> I'm using vim & gEdit..they seem fitting.

Yeah, that may be better.  Personally, I'm fond of KomodoEdit.

> 
> Thoughts please.
> 
> Thank you.


You are using test-first development and version control, right?


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

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



[Rails] before_filter question

2010-07-06 Thread Ralph Shnelvar
If one places a before_filter in class ApplicationController, when is
the before filter called and for which methods.


I believe it gets called before any "action" ... but how does rails know
that the method is an action?
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Re: Is this book dated?

2010-07-06 Thread Angel Robert Marquez
Thank you, appreciate it.

I'll read along, I just installed 3.0 and 1.9

That took some doing as well.

On Tue, Jul 6, 2010 at 7:03 AM, Eddy Josafat  wrote:

> The "classic" book for learning rails is "Agile Web Development with
> Rails", now in its fourth edition:
>
> http://www.pragprog.com/titles/rails4/agile-web-development-with-rails
>
> On 6 jul, 09:19, Angel Robert Marquez  wrote:
> > This was actually the book I have:http://apress.com/book/view/1590599942
> >
> > On Tue, Jul 6, 2010 at 12:57 AM, Angel Robert Marquez <
> >
> >
> >
> > angel.marq...@gmail.com> wrote:
> > > I know, I didn't notice the date until..now.
> >
> > > Good thing I didn't pay for it; but, it was new on the shelf at the
> > > bookstore. Mislead. Capistrano deployment should vaporize
> > > all unnecessary literature on the shelfs as well...
> >
> > > That would be nice if you could link the iPad or any and all other
> docs..so
> > > many ancient relics out their to sift through.
> >
> > > Any baby teeth recommendations for an eager beaver? I'm willing to
> learn
> > > and not looking to take over.
> >
> > > On Tue, Jul 6, 2010 at 12:47 AM, Frederick Cheung <
> > > frederick.che...@gmail.com> wrote:
> >
> > >> On Jul 6, 8:41 am, Angel Robert Marquez 
> > >> wrote:
> > >> >http://apress.com/book/view/9781590597811
> >
> > >> > I acquired this book and it has the info I thought I wanted; but,
> I'm
> > >> not
> > >> > sure.
> >
> > >> Well it does look a bit long in the tooth - The publication date is
> > >> given as oct 2007, shortly before the release of rails 2.0 and quite a
> > >> lot has changed since then
> >
> > >> Fred
> > >> > Is there something better more current out there? RESTful oath
> openid
> > >> etc..
> >
> > >> > I'm coming from a wordpress to cake, codeigniter tinkering and
> forget
> > >> why I
> > >> > tried rails; but, it seems pretty cool and intuitive.
> >
> > >> > Appreciate the Capistrano rec prior. Super good, like a dream come
> true.
> > >> Was
> > >> > able to deploy wp with it.
> >
> > >> > Also
> >
> > >> > Would you all recommend aptana radRails?
> >
> > >> > I'm using vim & gEdit..they seem fitting.
> >
> > >> > Thoughts please.
> >
> > >> > Thank you.
> >
> > >> --
> > >> You received this message because you are subscribed to the Google
> Groups
> > >> "Ruby on Rails: Talk" group.
> > >> To post to this group, send email to
> rubyonrails-t...@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> rubyonrails-talk+unsubscr...@googlegroups.com e...@googlegroups.com>
> > >> .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



Re: [Rails] Re: Generated By handling CRUD Scaffold

2010-07-06 Thread Jatin kumar
class CreateUsuarios < ActiveRecord::Migration
 def self.up
   create_table :usuarios do |t|
 t.string :nome

 *t.string :login, :limit => 20*
   e.g  *t.integer :age , :limit => 2  //Here you set the age to be a
short.ie.it now occupies only 2 byte rather than actual 4 bytes of integer*

  t.timestamps
   end
 end

This way you can set limits on the size of your columns. Regarding your
second question, I am still unable to get what you want to do.

On Mon, Jul 5, 2010 at 5:30 AM, Adriano Dias da Silva <
ti.adrian...@gmail.com> wrote:

> Regarding the first question, you can put an example?
>
> Currently in my db / migrate is thus:
>
> class CreateUsuarios < ActiveRecord::Migration
>  def self.up
>create_table :usuarios do |t|
>  t.string :nome
>  t.string :login
>
>  t.timestamps
>end
>  end
>
>  def self.down
>drop_table :usuarios
>  end
> end
>
> How to get the code?
>
> Referring to my second question I could find out how.
> Below is the link to you in Portuguese ...
>
> http://headfirstrails.clanteam.com/blog/category/rails
>
> Best Regards...
> Adriano Dias da Silva
> 
>
> On 4 jul, 16:34, Jatin kumar  wrote:
> > Regarding your first question,
> > You can't specify the size of the field while you are writing the
> scaffold
> > command in the command prompt.
> > But, there's a way you can do that.
> > Scaffolding makes a migration file for you, which actually makes the
> table
> > for your model. You will find your migration file in /db/migrate folder
> in
> > your application directory. Open your migration and add *,:limit =>
> > number *after
> > your column name.
> > Try it out..It worked for me.
> >
> > regarding your second question, could you be a little more clear about
> > adding on a password field.
> >
> > On Mon, Jul 5, 2010 at 12:56 AM, Adriano Dias da Silva <
> >
> > ti.adrian...@gmail.com> wrote:
> > > Good afternoon.
> >
> > > I have two questions:
> >
> > > First question:
> > > Can be defined at the time that I'm generating the scaffold the size
> > > of
> > > a string?
> > > For example name:string (50)?
> >
> > > Second question:
> > > I wonder how to proceed correctly to include new
> > > fields starting at a CRUD generated by scaffold.
> >
> > > Example:
> >
> > > First step (I use):
> > > script/generate scaffold User name:string login:string
> >
> > > Second step (I add the field "password: string" in the User CRUD,
> > > This field is a password varchar of 50 characters):
> > > Problem --->>> I do not do this modification to add a new
> > > field.
> >
> > > If you have any tutorial to make available, or, please specify
> > > step-by-step how to proceed.
> >
> > > Best Regards ...
> > > Adriano Dias da Silva
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Ruby on Rails: Talk" group.
> > > To post to this group, send email to rubyonrails-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.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



Re: [Rails] Re: mysql gem migrate "Unknown database '[db_development]" error

2010-07-06 Thread Jatin kumar
I am not sure of why this error is coming, but just for a moment, try rake
db:create before doing rake db:migrate.
It might solve your problem.

On Wed, Jul 7, 2010 at 12:22 AM, Oren Golan  wrote:

> I had this issue after upgrading from ubuntu 9.10 (karmic) to 10.4
> (lucid).
> the solution was to libmysqlclient16-dev:
>
> sudo aptitude install libmysqlclient16-dev
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: Ruby on Rails - RHEL

2010-07-06 Thread Gabor Antal

> http://blog.perplexedlabs.com/2009/01/13/installing-ruby-enterprise-edition-with-phusion-passenger/

Wow, cool link! Thanks!

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

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



[Rails] Re: SOAP web service

2010-07-06 Thread Robert Walker
codefusurfer wrote:
> I am looking for a way to host a SOAP Webserver that serves the data
> as SOAP document/literal. I know actionwebservice support SOAP RPC/
> encoded mode but I need document/literal. Anyone knows how to do this?

The Java and .Net worlds have lots of "nice" options for those seeking 
to torture themselves with SOAP web services. Ruby on Rails is VERY 
opinionated against SOAP in favor of REST, as am I.

I'm sure it can be done, but you'd likely be better off finding a forum 
devoted to providing SOAP with Ruby. I have a feeling you won't find 
much assistance here. I could be wrong though.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Helper in Initializer: Is it possible ?

2010-07-06 Thread Tom Ha
> What are you trying to achieve?

Basically, I put some Rufus scheduler code in the Initializer folder so 
the scheduler runs fine, even when the hoster needs to reboot the 
machine for whatever reason and without my knowledge.

The Rufus scheduler includes some .pdf-generating code (amongst other 
features). The .pdf must display numbers in a special format. And until 
now, I used helper code to get the numbers into this format, so it would 
have been convenient to use the same helper within this Rufus scheduler 
initializer..
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Rails 3.0 + Lighttpd + FCGI = RAGE

2010-07-06 Thread Marnen Laibow-Koser
Maccy wrote:
> Assuming then I would need to use apache.

Or Nginx.  Passenger works with either.

> Does passenger work with the
> mpm-worker module?

I don't recall, but I believe that got discussed on the list recently. 
Search the archives.

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

Sent from my iPhone
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: mysql gem migrate "Unknown database '[db_development]" error

2010-07-06 Thread Oren Golan
I had this issue after upgrading from ubuntu 9.10 (karmic) to 10.4 
(lucid).
the solution was to libmysqlclient16-dev:

sudo aptitude install libmysqlclient16-dev
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Re: Doesn't work erb engine

2010-07-06 Thread Hassan Schroeder
On Tue, Jul 6, 2010 at 10:13 AM, Karen Kalashyan  wrote:

> no :(
> WTF?!
> may be something wrong with macos 10.6.4 and current version of RoR?

What do you mean by "current"? 2.3.8, 3.0beta -- which is it?

Do you have a small test case you can post somewhere?

FWIW, I'm running 2.3.8 at the moment on Mac OS 10.6.4 with no
problems. Other than self-inflicted ones, of course :-)

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

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



[Rails] Re: Doesn't work erb engine

2010-07-06 Thread Frederick Cheung


On Jul 6, 9:09 am, Colin Law  wrote:

>
> I am out of ideas as to why the erb code is not being interpreted.  Anyone 
> else?
>

Random guess: a stray invisible character somewhere in the file.

Fred

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



Re: [Rails] Re: Doesn't work erb engine

2010-07-06 Thread Karen Kalashyan
2010/7/6 Angel Robert Marquez 

> config/routes.rb
> map.connect 'greeting', :controller => 'greeting', :action => 'index'
>
> ?
>
> On Mon, Jul 5, 2010 at 11:51 PM, Karen Kalashyan wrote:
>
>> 2010/7/6 Colin Law 
>>
>>> On 5 July 2010 09:42, Karen Kalashyan  wrote:
>>> > app/
>>> >
>>> > controllers/
>>> >
>>> > application_controller.rb
>>> >
>>> > greetings_controller.rb
>>> >
>>> > helpers/
>>> >
>>> > application_helper.rb
>>> > greetings_helper.rb
>>> >
>>> > models/
>>> >
>>> > photo.rb
>>> >
>>> > views/
>>> >
>>> > greetings/
>>> >
>>> > index.html.erb
>>> >
>>> > layouts/
>>> >
>>> >
>>> > greetings_controller.rb:
>>> > class GreetingsController < ApplicationController
>>> > def index
>>> > @mes = 'test'
>>> > end
>>> > end
>>> > index.html.erb
>>> > <%= @mes %>
>>> > html ouput (http://localhost:3000/greetings/
>>> > or http://localhost:3000/greetings/index/):
>>> > <%= @mes %>
>>> >
>>> > Why it's so hard?! :)
>>> > No bug report.. Nothing..
>>>
>>> Could you avoid top posting please, it makes it more difficult to
>>> follow the thread.
>>>
>>> What do you see in development.log?
>>>
>>> Which version of rails are you using?  You said 2.x but that covers a
>>> lot of versions.
>>>
>>> Colin
>>>
>>> >
>>> > 2010/7/5 Colin Law 
>>> >>
>>> >> On 4 July 2010 21:40, Karen Kalashyan  wrote:
>>> >> >> I don't understand the last bit of the sentence above.  Please
>>> expand
>>> >> >> what
>>> >> >> you
>>> >> >> mean by "/.erb/.html.erb - doesn't match".  Do you mean that
>>> >> >> /app/view/greeting/index.erb and /app/view/greeting/index.html.erb
>>> are
>>> >> >> ignored
>>> >> >> by the template engine?
>>> >> >
>>> >> > Yes!
>>> >> > It doesn't make sense.
>>> >> > I'm using 2.x version.
>>> >> > Now controller name is Greetings, and view file name is
>>> index.html.erb
>>> >> > But the problem hasn't been solved :(
>>> >>
>>> >> Please tell us the current filenames and contents again to make sure
>>> >> of what you have done.  Have you removed all the old files?  Rails has
>>> >> a habit of loading files that you have left lying around by accident.
>>> >> What exactly is the symptom now seen?
>>> >>
>>> >> Colin
>>>
>>
>>
>> i'm using last version from rubyonrails.org
>>
>> log:
>>[4;35;1mSQL (0.2ms) [0m   [0mSET SQL_AUTO_IS_NULL=0 [0m
>>
>>
>> Processing GreetingsController#index (for 127.0.0.1 at 2010-07-05
>> 12:41:42) [GET]
>> Rendering greetings/index
>> Completed in 2ms (View: 1, DB: 0) | 200 OK [
>> http://localhost/greetings/index/]
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Talk" group.
>> To post to this group, send email to rubyonrails-t...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> rubyonrails-talk+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>


config/routes.rb
map.connect 'greeting', :controller => 'greeting', :action => 'index'

?


no :(

WTF?!

may be something wrong with macos 10.6.4 and current version of RoR?

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



[Rails] Re: using ajax in nested attributes form

2010-07-06 Thread Mlle
yes I'm currently using those last railscasts methods but it's getting
pretty difficult to use the method in the edit form.


I am trying to follow an ajax method that should insert a new nested
attirubte form upon clicking a submit button in a form_remote_for.  I
put this in the create.rjs


association = :treatments
new_object =
@sample.class.reflect_on_association(association).klass.new

fields = :new_sample.fields_for(association, new_object, :child_index
=> "new_#{association}") do |builder|
  render(association.to_s.singularize + "_fields", :f => builder)
end

page.insert_html :bottom, :sample, fields


but I don't know how I can refer to the parent object's form in order
to call field_for.  ":new_sample" doesn't work.  Any ideas?




On Jul 6, 6:36 pm, Colin Law  wrote:
> On 6 July 2010 17:33, Mlle  wrote:
>
> > How can I use ajax to add nested attributes dynamically into the form
> > of an object?
>
> > I followed the railscast 
> > :http://railscasts.com/episodes/74-complex-forms-part-2
>
> > but I'd like to use Ajax instead because the method above is sort of
> > ugly.
>
> Have you seenhttp://railscasts.com/episodes/196-nested-model-form-part-1
> and part 2?  It does not use ajax but I would not describe it as ugly.
>
> Colin

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



Re: [Rails] using ajax in nested attributes form

2010-07-06 Thread Colin Law
On 6 July 2010 17:33, Mlle  wrote:
> How can I use ajax to add nested attributes dynamically into the form
> of an object?
>
> I followed the railscast : 
> http://railscasts.com/episodes/74-complex-forms-part-2
>
> but I'd like to use Ajax instead because the method above is sort of
> ugly.

Have you seen http://railscasts.com/episodes/196-nested-model-form-part-1
and part 2?  It does not use ajax but I would not describe it as ugly.

Colin

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



[Rails] Re: Helper in Initializer: Is it possible ?

2010-07-06 Thread Marnen Laibow-Koser
Tom Ha wrote:
> Hi there,
> 
> is there a way in Rails to use helpers in an Initializer ?

You should never need to.  Helpers are only for generating view code, 
and you shouldn't be doing that in initializers.
> 
> If yes, how ?
> 
> If no, where else to put the code needed in the Initializer (as well as
> in views) ? In the application_controller.rb ?
> 
> Thanks for any hints!
> Tom

What are you trying to achieve?


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

Sent from my iPhone
-- 
Posted via http://www.ruby-forum.com/.

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



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

2010-07-06 Thread Steve Spiller
On 6 July 2010 17:18, emptyset  wrote:

> Thanks!  I updated my answer on SU and linked to this post.  My best
> guess is that:
>
>  apt-get install ruby rdoc libopenssl-ruby build-essential
>
> Doesn't quite cover everything that's needed to run gem
> effectively...ruby-full on a clean VM install worked great.  Much
> appreciated.
>
> A guide which I found useful after failing to install properly (I have not
created the gem symlink) is http://ubuntuforums.org/showthread.php?t=1459056.
Covers pretty much everything I ended up doing through trial and error. Took
about 30 mins from start to finish.

Note: - where it gives the link to get rubygems don't forget to check for
the latest version and modify the command to match.

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



[Rails] using ajax in nested attributes form

2010-07-06 Thread Mlle
How can I use ajax to add nested attributes dynamically into the form
of an object?

I followed the railscast : 
http://railscasts.com/episodes/74-complex-forms-part-2

but I'd like to use Ajax instead because the method above is sort of
ugly.

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



Re: [Rails] Re: how to make confirm boxes conditional?

2010-07-06 Thread Peter De Berdt


On 06 Jul 2010, at 18:09, Lille wrote:


Actually, the matter is simpler than either of us seemed to
anticipate: the :confirm helper option just isn't very helpful. In
other words, all :confirm=>'Are you sure?' does is produce the raw
html onclick=>"return confirm('Are you sure?')". I had assumed that if
it were a helper, I should want to use it, not duplicate it, ergo my
post.

So, if anyone ever wants to make conditional the :confirm option of
the link_to/button_to erb function, use :onclick=>"if(...)
{ confirm('whatever text');}" -- involving whatever conditional logic
you like in the raw javascript.


Sure, but inline javascript like that is just a horrible thing :-)


Best regards

Peter De Berdt

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



Re: [Rails] how to create virtual domain name for RoR application?

2010-07-06 Thread Norm Scherer




Hassan Schroeder wrote:

  On Tue, Jul 6, 2010 at 12:56 AM, sumanta  wrote:

  
  
Now suppose my IP(local) number is 192.168.0.3. how can I create a
virtual name for the application ? so that I can use www.example.com
rather http://192.168.03:3000/login_c.

  
  
This has nothing to do with Rails; your local DNS needs a record for
the server, with whatever name(s) you choose.
  

Or for a very
small setup where you may not have a dns server (like in my den) I just
put entries in /etc/hosts on all of the  systems.  It helps to
configure your dhcp server (if you use one) to use fixed addresses for
the server 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-t...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




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

2010-07-06 Thread emptyset
Thanks!  I updated my answer on SU and linked to this post.  My best
guess is that:

  apt-get install ruby rdoc libopenssl-ruby build-essential

Doesn't quite cover everything that's needed to run gem
effectively...ruby-full on a clean VM install worked great.  Much
appreciated.

On Jul 3, 9:47 am, Filipe Quadros Borges  wrote:
> I installed Ruby and Rails on Ubuntu 10.04 by following this 
> guide:https://help.ubuntu.com/community/RubyOnRails.
> Everything went well.
>
> Quick steps:
>  1. > sudo apt-get install ruby-full build-essential
>  2. Download and install latest rubygems. Do not use apt-get because
> rubygems update itself and corrupts apt-get.
>  3. > sudo gem install rails
>  4. test your environment! > rails ~/my_test_app
>
>
>
>
>
> On Wed, Jun 30, 2010 at 2:03 PM, emptyset  wrote:
> > I'm reposting this here from my original post on Superuser[1], to
> > hopefully get more relevant feedback from more experienced RoR users.
> > I need to get a RoR environment up and running, because I have a
> > client that needs some RoR work done on her website.  Although I'm new
> > to RoR, I'm a quick learner and was expecting installing and setting
> > up the environment was easy, so I could focus my effort on site
> > development.  I've already spent five days trying to get the
> > environment up so I could just begin working.  I'll probably have
> > follow up questions to this group (seems I can't get script/server to
> > work at all) - but for now, this is the immediate concern.
>
> > Update #3: Starting over from scratch, shortened this post, decided to
> > re-install a clean copy of Ubuntu 10.04 on a VM and go through the
> > walk-through[0] again. So, all the steps go without a hitch. As root:
>
> > r...@ubuntu:~/rubygems-1.3.7# ruby -v
> > ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
> > r...@ubuntu:~/rubygems-1.3.7# gem -v
> > 1.3.7
> > r...@ubuntu:~/rubygems-1.3.7# rails -v
> > Rails 2.3.8
> > Now, as myself (in a separate term):
>
> > empty...@ubuntu:~$ ruby -v
> > ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
> > empty...@ubuntu:~$ gem -v
> > /usr/local/lib/site_ruby/1.8/rubygems.rb:10:in `require': no such file
> > to load -- rubygems/defaults (LoadError)
> >    from /usr/local/lib/site_ruby/1.8/rubygems.rb:10
> >    from /usr/local/bin/gem:8:in `require'
> >    from /usr/local/bin/gem:8
> > empty...@ubuntu:~$ rails -v
> > bash: /usr/bin/rails: Permission denied
>
> > So, this appears to be a permissions issue, but I don't understand
> > why. Specifically, if I have to start making things go+rx all over the
> > place, I really need to understand which specific files need the
> > permissions change.
>
> > Site references:
> > [0]http://castilho.biz/blog/2010/05/08/how-to-install-ruby-on-rails-on-u...
> > [1]http://superuser.com/questions/156498/installing-ruby-on-rails-on-ubu...
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Ruby on Rails: Talk" group.
> > To post to this group, send email to rubyonrails-t...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > rubyonrails-talk+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> Filipe Quadros Borges
>
> email: fqbor...@gmail.com
> msn: fqbor...@hotmail.com

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



[Rails] Re: how to make confirm boxes conditional?

2010-07-06 Thread Lille
Peter,

Actually, the matter is simpler than either of us seemed to
anticipate: the :confirm helper option just isn't very helpful. In
other words, all :confirm=>'Are you sure?' does is produce the raw
html onclick=>"return confirm('Are you sure?')". I had assumed that if
it were a helper, I should want to use it, not duplicate it, ergo my
post.

So, if anyone ever wants to make conditional the :confirm option of
the link_to/button_to erb function, use :onclick=>"if(...)
{ confirm('whatever text');}" -- involving whatever conditional logic
you like in the raw javascript.

Lille

On Jul 6, 10:23 am, Peter De Berdt  wrote:
> On 06 Jul 2010, at 14:47, Lille wrote:
>
> > I'd like to make the :confirm option in my link_to/button_to erb
> > elements conditional. So, if the page is in some state, no
> > confirmation is requested, but not otherwise, etc.
>
> > So far, my only (ugly) approach is to replace the linker html itself
> > depending on changes in state, but I believe there must be an easier
> > way to 'toggle' the confirmation option on/off.
>
> > Can anyone recommend an approach?
>
> Write your own Javascript which handles these page state changes and  
> confirmation instead of relying on Rails Javascript helpers. Those  
> helpers were only made for the most basic operations. You wouldn't use  
> a teaspoon to empty a bath either, even if you could put a bigger  
> handle on the spoon.
>
> Flow:
> - Observe link clicks (you can add a class="confirmable" or something  
> to them if you want to apply it only to that element)
> - Observe the elements on the page that will trigger a state change
> - If those elements are changed, add the state to window or something
> - When a link is clicked, it should see if window.state_changed ==  
> true and display the confirmation, if not, just window.location ==  
> link.href
>
> You would be best off implementing this in an event delegated way if  
> there's a lot of elements that can change the page state, as well as  
> new elements being injected into the page via AJAX.
>
> Best regards
>
> Peter De Berdt

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



[Rails] Helper in Initializer: Is it possible ?

2010-07-06 Thread Tom Ha
Hi there,

is there a way in Rails to use helpers in an Initializer ?

If yes, how ?

If no, where else to put the code needed in the Initializer (as well as
in views) ? In the application_controller.rb ?

Thanks for any hints!
Tom
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: schema.rb parser available?

2010-07-06 Thread Marnen Laibow-Koser
Tom Tom wrote:
> hi, is there a parser avaliable to create all MVC-files based on the
> schema.rb or an exisiting db?
> thx

You're asking the impossible.  The Ruby classes cannot be reliably 
deduced from the database schema alone.  Human thought is necessary 
here.

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

Sent from my iPhone
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Simple question about submit

2010-07-06 Thread Marnen Laibow-Koser
Rob Nichols wrote:
> Marnen Laibow-Koser wrote:
>> Whatever the  tag's action is.
> 
> Also, if no action is specified via the form tag, the form is submitted 
> to the current url.
> 
> So if 'thing/edit/1' contained:
> 
> 
>   
> 
> 
> The form would be submitted back to 'thing/edit/1'

No.   without an action is invalid HTML, so its behavior is 
undefined.  An action must always be specified.

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

Sent from my iPhone
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Simple question about submit

2010-07-06 Thread Marnen Laibow-Koser
Ralph Shnelvar wrote:
> Rob and  Marnen:
> 
> Thank you!
> 
> I am now curious why the designers of HTML put the "place to go" on the 
> form tag rather than on the  tag.
> 

My guess: the idea is that the action is a property of the *form*, not 
the submit button.  But take this up on an HTML forum if you want better 
answers.  We're out of Rails territory here.


> Ralph

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

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



[Rails] schema.rb parser available?

2010-07-06 Thread tom
hi, is there a parser avaliable to create all MVC-files based on the
schema.rb or an exisiting db?
thx

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



[Rails] Rails 3: link_to :remote => true with spinner

2010-07-06 Thread Sharkie Landshark
How is this most efficiently done? link_to_remote is gone.

I am using jQuery and am wondering how I could bind beforeSend call back
with my link_to :remote => true call. So that I can use it to draw
spinner.

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

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



Re: [Rails] Looking for some input on career advancement w/ Rails

2010-07-06 Thread Jason Michael
Hassan is right - I'm working at a smallish startup (<100 employees) -
it's scary at times, but I don't live in fear of missing a paycheck.
Conversely, the budget and purse strings are rather loose here, and
the perks are often nice.  The best benefit of taking a job at a
startup is the opportunities for creativity in problem solving.  At
BigCo, they already have a process fully defined, you're Cog # 389976,
you do your part of the process.  At TeenyCo, nobody knows quite what
they're doing half the itme and *you get to define the process* from
whole cloth.  It's cool.  Try it, you'll like it.

On Tue, Jul 6, 2010 at 9:53 AM, Hassan Schroeder
 wrote:
> On Mon, Jul 5, 2010 at 10:46 PM, Phoenix Rising  
> wrote:
>
>> On the first point, am I being too paranoid about working for start-
>> ups?  My biggest fear, career-wise, is to go to work one morning and
>> find the stereotypical 2001 nightmare scenario where the office is
>> shut down, locked up, nobody has a job and the CEO is running off with
>> a couple hundred grand in investment cash, leaving all the employees
>> screwed.
>
> Wow, that's negative. Sure, in some cases people didn't get paid for
> their last couple of weeks work which is unfortunate, but "screwed"?
>
> If you got paid while you were there and learned a lot, what's the big
> deal? You could as easily come to work at BigCo one day to find out
> your division was being shut down and poof! there goes that job.
>
> How does that feel different? Having gone through both scenarios,
> I'd say: not at all. Next step in each case: go find some other work.
>
> And personally, assuming I wanted a "job", I would far rather be part
> of a small team at a startup than Anonymous Cog # 389976 at BigCo.
>
> YMMV  :-)
> --
> Hassan Schroeder  hassan.schroe...@gmail.com
> twitter: @hassan
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: flash message not clear

2010-07-06 Thread Florent2
Finally I could reproduce the bug in a freshly created Rails 3
application, requiring one by one the gems I used in my first
application. The bug occurs when both twitter and sg-ruby gems are
required from Gemfile. If only one of both is required, the bug
disappears. Reading through the code of both gems, I could not figure
out how the bug appears. So to avoid the bug I just switched from the
twitter gem to the grackle gem.

Florent

On 4 juil, 23:24, Florent2  wrote:
> Hello,
>
> I have a Rails 3 beta 4 where flash messages are not cleared when they
> should be. Please note that on a freshly created Rails 3 beta 4
> application I do not face the problem. I searched for something flash
> specific in my application that could cause the problem, but I found
> nothing.
>
> In the home page controller action I set flash.now.notice = "hello".
> This flash message is correctly displayed on the home page.
>
> But when I request another page, the flash message is still displayed
> although I do not set a flash message in this other page controller
> action.
>
> In my application controller, I log the content of the
> session['flash'] object in a before filter and in an after filter.
> Here is what I get:
>
> 1. request on the homepage setting the flash message:
> - before filter: session['flash'] = nil
> - after filter   : session['flash'] = {:notice=>"hello"}
>
> 2. request on another page not setting the flash message:
> - before filter: session['flash'] = {"notice"=>"hello"}
> - after filter   : session['flash'] = {"notice"=>"hello"}
>
> I don't understand why the session['flash'] contains {"notice" =>
> "hello"} at the beginning of the request of the second page.
> The :notice key has correctly disappeared but a new key "notice" has
> appeared. That's what provokes the unwanted display of the flash
> message on the second request.
>
> I've looked into the ActionDispatch::Flash class and tried to log what
> happened in the sweep function
>  http://github.com/rails/rails/blob/master/actionpack/lib/action_dispa...
> The problem is that the key "notice" is not deleted as @used set
> contains :notice where the flash keys contains "notice".
>
> I could not figure out how and where in the code the flash object is
> reconstructed from the cookie session. Also, is it possible from the
> browser to read the content of the Rails cookie session to directly
> see how is the flash stored in the cookie?
>
> Any help or indication to further dig in my problem would be greatly
> appreciated :)
>
> Florent

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



[Rails] Re: Re: Re: How can I hide my Ruby code?

2010-07-06 Thread Robert Walker
Andy Jeffries wrote:
> On 6 July 2010 10:34, Sumanta Das  wrote:
> 
>> Or if there is any way so that I can encrypt my code
>> without interrupting the execution of the application.

If your client is determined to access your code even an encryption of 
the Ruby source code will not be sufficient. In order for MRI to 
interpret Ruby it must be decrypted. If the client has full access to 
the system then this means that they also have access to the encryption 
keys.

This is the same issue that makes decrypting DVDs possible. The keys 
must be available to the system performing the decryption. Now maybe 
doing this will discourage a client from making the attempt, but if they 
are determined then there's nothing stopping them from hiring someone to 
"crack" your encryption. But, as I said it's not really cracking it 
since the encryption keys exist in a location where the client has 
access.

Other compiled languages such as Java or .Net don't effectively protect 
your code either. Java (and likely .Net) can be easily decompiled into 
amazingly readable source code.

In the end the only real solution is to protect your source code using 
operating system security and by contractual licensing.
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Re: Re: Re: Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Colin Law
On 6 July 2010 15:23, Pale Horse  wrote:
> Colin Law wrote:
 Actually I think maybe it would be worthwhile knowing what your model
 relationships are. �If you have the model relationships right then you
 can do clever things with nested forms. �See
 http://railscasts.com/episodes/196-nested-model-form-part-1 for
 example.
>>
>> You have not responded to the above
>>

 Colin
>>>
>>> As I've said, this form isn't related to a model. It simply collects the
>>> parameters and mails them.
>>
>> In that case what is :order?
>>
>> You have not responded to my comments above suggesting where you may
>> be going wrong.
>>
>> Colin
>
> I was wrong to use :order because this is not a model form.
>
> So, http://pastie.org/1032691 should look more appropriate.

What about my other comments (snipped again I notice, I will go back
to the previous email to get them):
>>  Since you are attempting to pass a number of
>> different quantities each must have a different name.  In fact you
>> probably want to pass them as an array.

If you look at the html you should see that all the quantity input
fields have the same name so they will all be in the same parameter in
params which is no good.  Google for text_field_tag array to find
examples of how to do pass an array of values.

I still don't understand why you have not got an order model (it does
not have to map to a table in the db).  Where are you putting the
business logic for an order if you have not got an order model?

Colin

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



[Rails] Re: Simple question about submit

2010-07-06 Thread Ralph Shnelvar
Rob and  Marnen:

Thank you!

I am now curious why the designers of HTML put the "place to go" on the 
form tag rather than on the  tag.

Ralph

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

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



Re: [Rails] Looking for some input on career advancement w/ Rails

2010-07-06 Thread Hassan Schroeder
On Mon, Jul 5, 2010 at 10:46 PM, Phoenix Rising  wrote:

> On the first point, am I being too paranoid about working for start-
> ups?  My biggest fear, career-wise, is to go to work one morning and
> find the stereotypical 2001 nightmare scenario where the office is
> shut down, locked up, nobody has a job and the CEO is running off with
> a couple hundred grand in investment cash, leaving all the employees
> screwed.

Wow, that's negative. Sure, in some cases people didn't get paid for
their last couple of weeks work which is unfortunate, but "screwed"?

If you got paid while you were there and learned a lot, what's the big
deal? You could as easily come to work at BigCo one day to find out
your division was being shut down and poof! there goes that job.

How does that feel different? Having gone through both scenarios,
I'd say: not at all. Next step in each case: go find some other work.

And personally, assuming I wanted a "job", I would far rather be part
of a small team at a startup than Anonymous Cog # 389976 at BigCo.

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

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



Re: [Rails] Re: Re: Re: How can I hide my Ruby code?

2010-07-06 Thread Peter De Berdt
Exactly, proper permission management in Linux is the key to making  
this work. On top of that, if it's an internet-enabled server, I would  
never ever ever ever ever allow username + password access to the  
server unless that user is sandboxed, let alone allow root access  
(which is like putting a big sign on your porch saying: THE KEY IS  
UNDERNEATH THE DOORMAT). Use SSH key-based authentication instead.  
Give your customer an account that has rights to view their own home  
folder, but nothing else.


If you really want to hide the code from the customer, host it  
yourself and let them pay for the hosted solution. If that's a no go  
and they don't want to give up their server management rights, then  
just rely on a very good contract (i.e. let a lawyer make it) that  
prohibits them from messing with the code. We should all know by know  
how effective DRM is, in whatever form you want to sell it (hiding  
code, checking licenses, always online measures, …)


The company I work for had the same mindset, since we came from  
desktop apps where we had set up this whole structure of internet  
authenticating clients and monitoring systems and license keys and  
what not. My boss was afraid that our RoR projects would be copied or  
distributed illegally and he would lose money. Well, we didn't  
implement any security at all, and we've made a lot more money more  
than we used to, simply because we could spend more time making a  
great app instead of implementing great license validations and  
restrictions (if you can call those great to start off with). If  
you're worried about them changing the maximum number of users etc in  
your code, rethink your licensing strategy.


On 06 Jul 2010, at 15:39, Jason Michael wrote:


You do this in linux - not in ruby.  Make the directory and all the
files viewable by no one but the process that runs them
(apache.apache), and make it so no one can login as apache.apache.  Of
course, if you login as root, you can see anything, so if the client
has root then all bets are off.



On Tue, Jul 6, 2010 at 8:35 AM, Sumanta Das   
wrote:
Yes, Sir. I am trying to hide the code from client due to some  
reason. I

am afraid of code tampering. So I want to hide it.


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



Re: [Rails] how to make confirm boxes conditional?

2010-07-06 Thread Peter De Berdt


On 06 Jul 2010, at 14:47, Lille wrote:


I'd like to make the :confirm option in my link_to/button_to erb
elements conditional. So, if the page is in some state, no
confirmation is requested, but not otherwise, etc.

So far, my only (ugly) approach is to replace the linker html itself
depending on changes in state, but I believe there must be an easier
way to 'toggle' the confirmation option on/off.

Can anyone recommend an approach?


Write your own Javascript which handles these page state changes and  
confirmation instead of relying on Rails Javascript helpers. Those  
helpers were only made for the most basic operations. You wouldn't use  
a teaspoon to empty a bath either, even if you could put a bigger  
handle on the spoon.


Flow:
- Observe link clicks (you can add a class="confirmable" or something  
to them if you want to apply it only to that element)

- Observe the elements on the page that will trigger a state change
- If those elements are changed, add the state to window or something
- When a link is clicked, it should see if window.state_changed ==  
true and display the confirmation, if not, just window.location ==  
link.href


You would be best off implementing this in an event delegated way if  
there's a lot of elements that can change the page state, as well as  
new elements being injected into the page via AJAX.



Best regards

Peter De Berdt

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



[Rails] Re: Re: Re: Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Pale Horse
Colin Law wrote:
>>> Actually I think maybe it would be worthwhile knowing what your model
>>> relationships are. �If you have the model relationships right then you
>>> can do clever things with nested forms. �See
>>> http://railscasts.com/episodes/196-nested-model-form-part-1 for
>>> example.
> 
> You have not responded to the above
> 
>>>
>>> Colin
>>
>> As I've said, this form isn't related to a model. It simply collects the
>> parameters and mails them.
> 
> In that case what is :order?
> 
> You have not responded to my comments above suggesting where you may
> be going wrong.
> 
> Colin

I was wrong to use :order because this is not a model form.

So, http://pastie.org/1032691 should look more appropriate.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] respond partial content

2010-07-06 Thread Jarl Friis
Hi.

This may seem like an absurd request. However it is becausy I
integrate with a legacy system.

I am in the need to respond partial content (flush) before the action
is fully complete. This should prevent the legacy system to timeout.

I need to send HTTP headers and some content (to indicate to the
client that my rails app is actually alive), and the at the end of the
action to complete and close the connection.

Something like this

def index
  respond_headers
  do_something_that_takes_a_long_time #more than a minute
  render :text => 'DONE'
end

Does anybody know how to do this?

Jarl

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



[Rails] Re: Looking for some input on career advancement w/ Rails

2010-07-06 Thread Eddy Josafat
Have look at "The Passionate Programmer", by Chad Fowler. It's worth
the time you spend reading it.

http://www.pragprog.com/titles/cfcar2/the-passionate-programmer

I've been working many years as project manager, and now I'm very
happy working "only" as senior developer. I think career advancement
isn't equal to "advance" to management jobs...

On 6 jul, 09:12, Michael Pavling  wrote:
> On 6 July 2010 06:46, Phoenix Rising  wrote:
>
> > Hey all,
>
> > I'm having a tough time finding a good job working with Ruby and
> > Rails,
> > I *know* this stuff reasonably well.
> > The problem is that I often get thrown all kinds of strange
> > theoretical questions out of left field.  For example, "what are the
> > different levels of database normalization?"  When I heard that, I
>
> I understand your pain - I've meandered into developing over many
> years, but with no history of formal training in computer science, so
> some of the terminology that should be "obvious" goes past me too.
>
> > (a) most of the Rails-
> > related jobs I've found are with start-ups, (b) the ones I've found
> > with "stable" or "established" companies usually involve tech screens
> > that I've had a hard time passing, and (c) I don't think I want to be
> > writing code the rest of my life, but I feel like there's a bit of a
> > barrier between technology people and allowing them the chance to
> > transition to technology management.
>
> You don't say where in the world you are... I'm in the UK, and focus
> on short-term contract/freelance roles. The market for Rails here is
> quite quiet - with more permanent jobs appearing than contracts. But
> the permanent rates seem very low - I think a lot of companies are
> hoping to get graduates with no experience to hit the ground
> running...
>
> > On the first point, am I being too paranoid about working for start-
> > ups?  is a fear like this in today's modern
> > silicon valley environment?
>
> It's just as likely to happen for whatever company you work for - I
> say to my friends, who claim they couldn't take the "unpredicability"
> of contracting, that at least I know I have a job for the next three
> months, which is more than they can say ;-)
>
> > it's just the formalized theoretical stuff I'm weak on.
> > Can anyone recommend any books on OOP design that may help with these
> > stupid tech screens?  Or do you have any other recommendations on this
> > at all?
>
> The Object Orientated Though 
> Processhttp://www.amazon.co.uk/Object-Oriented-Thought-Process-Developers-Li...
>
> Coder to 
> Developerhttp://www.amazon.co.uk/Coder-Developer-Strategies-Delivering-Softwar...
>
> Computer Science: an 
> Overviewhttp://www.amazon.co.uk/Computer-Science-Overview-Glenn-Brookshear/dp...
>
> I've read all three of the above, and the first two are very good
> personal development books. The third is good for filling in the
> blanks - and you might skip chunks of it.
>
> > Finally, regarding management.  Has anyone else felt like there's an
> > invisible barrier that people just will never give them a chance to be
> > in a leadership or management position?
>
> Management: they're not starting up their companies to make *you* rich ;-)

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



[Rails] Re: Is this book dated?

2010-07-06 Thread Eddy Josafat
The "classic" book for learning rails is "Agile Web Development with
Rails", now in its fourth edition:

http://www.pragprog.com/titles/rails4/agile-web-development-with-rails

On 6 jul, 09:19, Angel Robert Marquez  wrote:
> This was actually the book I have:http://apress.com/book/view/1590599942
>
> On Tue, Jul 6, 2010 at 12:57 AM, Angel Robert Marquez <
>
>
>
> angel.marq...@gmail.com> wrote:
> > I know, I didn't notice the date until..now.
>
> > Good thing I didn't pay for it; but, it was new on the shelf at the
> > bookstore. Mislead. Capistrano deployment should vaporize
> > all unnecessary literature on the shelfs as well...
>
> > That would be nice if you could link the iPad or any and all other docs..so
> > many ancient relics out their to sift through.
>
> > Any baby teeth recommendations for an eager beaver? I'm willing to learn
> > and not looking to take over.
>
> > On Tue, Jul 6, 2010 at 12:47 AM, Frederick Cheung <
> > frederick.che...@gmail.com> wrote:
>
> >> On Jul 6, 8:41 am, Angel Robert Marquez 
> >> wrote:
> >> >http://apress.com/book/view/9781590597811
>
> >> > I acquired this book and it has the info I thought I wanted; but, I'm
> >> not
> >> > sure.
>
> >> Well it does look a bit long in the tooth - The publication date is
> >> given as oct 2007, shortly before the release of rails 2.0 and quite a
> >> lot has changed since then
>
> >> Fred
> >> > Is there something better more current out there? RESTful oath openid
> >> etc..
>
> >> > I'm coming from a wordpress to cake, codeigniter tinkering and forget
> >> why I
> >> > tried rails; but, it seems pretty cool and intuitive.
>
> >> > Appreciate the Capistrano rec prior. Super good, like a dream come true.
> >> Was
> >> > able to deploy wp with it.
>
> >> > Also
>
> >> > Would you all recommend aptana radRails?
>
> >> > I'm using vim & gEdit..they seem fitting.
>
> >> > Thoughts please.
>
> >> > Thank you.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Ruby on Rails: Talk" group.
> >> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> rubyonrails-talk+unsubscr...@googlegroups.com >>  e...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/rubyonrails-talk?hl=en.

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



Re: [Rails] Re: rails 3 release date

2010-07-06 Thread Conrad Taylor


Sent from my iPhone

On Jul 5, 2010, at 4:41 PM, David Zhu  wrote:

> 
> 
>> I read DHH said it should be released by August, can't find the link right 
>> now.
> 
> If start a new project in rails 3 beta now, and update to the stable
> in the future when its released, i wouldn't have to make many changes
> to my rails project right?
> 

You shouldn't have to make many changes at all going from Rails 3 beta 4 to 
Rails 3 final.

> So if you had to start a new project now, would you choose the beta,
> or the current stable?
> 

What are your current system requirements as well as your plugin/gem 
dependencies?  If you know this information, then you should be able to make an 
informed decision as to whether to use Rails 3 or Rails 2.

Good luck,

-Conrad

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

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



[Rails] Problems installing Flotilla - no such file -- FileUtils

2010-07-06 Thread Colin Law
Hi

I am attempting to install the Flotilla plugin for the flot javascript
charting library.


I have tried to install Flotilla using
ruby script/plugin install git://github.com/joshuamiller/flotilla.git

All seems ok till it attempts to do the install then I get
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- FileUtils (LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /home/colinl/websites/weather/vendor/plugins/flotilla/install.rb:1
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/plugin.rb:235:in
`load'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/plugin.rb:235:in
`run_install_hook'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/plugin.rb:196:in
`install'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/plugin.rb:811:in
`parse!'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/plugin.rb:810:in
`each'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/plugin.rb:810:in
`parse!'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/plugin.rb:518:in
`parse!'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/plugin.rb:534:in
`parse!'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/plugin.rb:968
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/plugin:3

Google has not been able to help me, or at least I have been unable to
ask it the right questions.

Rails version 2.3.8, though that is obvious from the trace.
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
Ubuntu 10.04

Any help would be much appreciated.

Colin

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



[Rails] SOAP web service

2010-07-06 Thread codefusurfer
I am looking for a way to host a SOAP Webserver that serves the data
as SOAP document/literal. I know actionwebservice support SOAP RPC/
encoded mode but I need document/literal. Anyone knows 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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



Re: [Rails] Re: Re: Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Colin Law
On 6 July 2010 14:35, Pale Horse  wrote:
> Colin Law wrote:
>> On 6 July 2010 13:13, Pale Horse  wrote:
>>> http://pastie.org/1032538
>>
>> Once again you have snipped all the content so this will make no sense
>> to anyone reading it without referring back to previous messages.
>
> Sorry, but they can always refer to this forum topic to view the
> previous messages. I don't know which mailing list you're posting from
> but it *should* have the facility to view the original post.

This is a mailing list, not a forum.  You may be viewing it elsewhere
but the original is the mailing list.
http://groups.google.com/group/rubyonrails-talk

>
>> What is this :order that you are referencing?  Check the docs on
>> text_field and you will find that it is designed to be used with
>> attribute of an object.  You have specified the product_quantity of
>> the order object.  Since you are attempting to pass a number of
>> different quantities each must have a different name.  In fact you
>> probably want to pass them as an array.  As I said before I would use
>> text_field_tag in this situation.

You have not responded to the above

>>
>> Also I would suggest using form_for if you do have an order model, for
>> the attributes.

You have not responded to the above

>>
>> Actually I think maybe it would be worthwhile knowing what your model
>> relationships are.  If you have the model relationships right then you
>> can do clever things with nested forms.  See
>> http://railscasts.com/episodes/196-nested-model-form-part-1 for
>> example.

You have not responded to the above

>>
>> Colin
>
> As I've said, this form isn't related to a model. It simply collects the
> parameters and mails them.

In that case what is :order?

You have not responded to my comments above suggesting where you may
be going wrong.

Colin

>
> I want the output to be similar to:
>
> Product A: 
> Product B: 
> Product C: 
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Update file field..

2010-07-06 Thread Hemant Bhargava
Hello champs,

I have uploaded a file and saved it in tmp/ location. But now i need to
update this file field. I mean i need to replace that file with another
file.
While uploading, i used this:-
@Resume = Resume.new(params[:resume]) .. This will call my model
function upload_resume=() which will actually upload file.

Can you guys tell me/light me/tutorials that how should i update it?

Thanks in advance to you people.
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Re: Re: Re: How can I hide my Ruby code?

2010-07-06 Thread Jason Michael
You do this in linux - not in ruby.  Make the directory and all the
files viewable by no one but the process that runs them
(apache.apache), and make it so no one can login as apache.apache.  Of
course, if you login as root, you can see anything, so if the client
has root then all bets are off.



On Tue, Jul 6, 2010 at 8:35 AM, Sumanta Das  wrote:
> Yes, Sir. I am trying to hide the code from client due to some reason. I
> am afraid of code tampering. So I want to hide it.
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-t...@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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



[Rails] Re: Re: Re: How can I hide my Ruby code?

2010-07-06 Thread Sumanta Das
Yes, Sir. I am trying to hide the code from client due to some reason. I 
am afraid of code tampering. So I want to hide it.
-- 
Posted via http://www.ruby-forum.com/.

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



[Rails] Re: Re: Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Pale Horse
Colin Law wrote:
> On 6 July 2010 13:13, Pale Horse  wrote:
>> http://pastie.org/1032538
> 
> Once again you have snipped all the content so this will make no sense
> to anyone reading it without referring back to previous messages.

Sorry, but they can always refer to this forum topic to view the 
previous messages. I don't know which mailing list you're posting from 
but it *should* have the facility to view the original post.

> What is this :order that you are referencing?  Check the docs on
> text_field and you will find that it is designed to be used with
> attribute of an object.  You have specified the product_quantity of
> the order object.  Since you are attempting to pass a number of
> different quantities each must have a different name.  In fact you
> probably want to pass them as an array.  As I said before I would use
> text_field_tag in this situation.
> 
> Also I would suggest using form_for if you do have an order model, for
> the attributes.
> 
> Actually I think maybe it would be worthwhile knowing what your model
> relationships are.  If you have the model relationships right then you
> can do clever things with nested forms.  See
> http://railscasts.com/episodes/196-nested-model-form-part-1 for
> example.
> 
> Colin

As I've said, this form isn't related to a model. It simply collects the 
parameters and mails them.

I want the output to be similar to:

Product A: 
Product B: 
Product C: 
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] Help - Google Charts on Rails Plugin

2010-07-06 Thread Bill Walton
Hi Juliana,

On Mon, Jul 5, 2010 at 4:48 PM, Juliana Cindra  wrote:
> I'm starting at the RR, and I'm trying to use google charts to generate some
> graphs in a single plugin in rails. But I'm testing the samples that are
> giving errors. I think it must be configuration error. Someone who has used
> google charts on rails help me?

You'll need to provide more information in order to get help.  What
plugin are you using?  Show a small example of how you're using it,
and the error that you're getting.

Best regards,
Bill

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



Re: [Rails] Re: Re: How can I hide my Ruby code?

2010-07-06 Thread Colin Law
On 6 July 2010 13:18, Andy Jeffries  wrote:
> On 6 July 2010 11:31, Michael Pavling  wrote:
>>
>> On 6 July 2010 11:19, Andy Jeffries  wrote:
>> > You can do this (I've had to do it for a client) but it's not simple
>> > 
>>
>> Very interesting approach. Will file that for future reference.
>
> I hope you never need it :-)
>
>>
>> > The last step, if you're using Passenger ensure that the last child is
>> > never
>> > killed off (if it is, it will lose the decryption key which is now only
>> > in
>> > memory).  I can't remember the setting but there's a timeout setting
>> > which
>> > you can set to zero so the last child never dies.
>>
>> Hope you've got good UPS and redundancy too (and a well-negotiated
>> call-out fee to re-encrypt everything if the YTS boy unplugs the power
>> :-)
>
> We're developing the site but the day to day running is down the client (but
> they have lots of power from various sources, redundancy and sysadmins to
> type the password back in).

Is the client trying to keep the code hidden from his own sysadmins or
are you trying to hide it from the client?

Colin

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



Re: [Rails] Re: Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Colin Law
On 6 July 2010 13:13, Pale Horse  wrote:
> http://pastie.org/1032538

Once again you have snipped all the content so this will make no sense
to anyone reading it without referring back to previous messages.

What is this :order that you are referencing?  Check the docs on
text_field and you will find that it is designed to be used with
attribute of an object.  You have specified the product_quantity of
the order object.  Since you are attempting to pass a number of
different quantities each must have a different name.  In fact you
probably want to pass them as an array.  As I said before I would use
text_field_tag in this situation.

Also I would suggest using form_for if you do have an order model, for
the attributes.

Actually I think maybe it would be worthwhile knowing what your model
relationships are.  If you have the model relationships right then you
can do clever things with nested forms.  See
http://railscasts.com/episodes/196-nested-model-form-part-1 for
example.

Colin

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



[Rails] how to make confirm boxes conditional?

2010-07-06 Thread Lille
Hi,

I'd like to make the :confirm option in my link_to/button_to erb
elements conditional. So, if the page is in some state, no
confirmation is requested, but not otherwise, etc.

So far, my only (ugly) approach is to replace the linker html itself
depending on changes in state, but I believe there must be an easier
way to 'toggle' the confirmation option on/off.

Can anyone recommend an approach?

Thanks,

Lille

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



Re: [Rails] Re: Re: How can I hide my Ruby code?

2010-07-06 Thread Andy Jeffries
On 6 July 2010 11:31, Michael Pavling  wrote:

> On 6 July 2010 11:19, Andy Jeffries  wrote:
> > You can do this (I've had to do it for a client) but it's not simple
> > 
>
> Very interesting approach. Will file that for future reference.
>

I hope you never need it :-)


> > The last step, if you're using Passenger ensure that the last child is
> never
> > killed off (if it is, it will lose the decryption key which is now only
> in
> > memory).  I can't remember the setting but there's a timeout setting
> which
> > you can set to zero so the last child never dies.
>
> Hope you've got good UPS and redundancy too (and a well-negotiated
> call-out fee to re-encrypt everything if the YTS boy unplugs the power
> :-)


We're developing the site but the day to day running is down the client (but
they have lots of power from various sources, redundancy and sysadmins to
type the password back in).

Cheers,


Andy

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



[Rails] Re: Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Pale Horse
http://pastie.org/1032538
-- 
Posted via http://www.ruby-forum.com/.

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



Re: [Rails] how to create virtual domain name for RoR application?

2010-07-06 Thread Hassan Schroeder
On Tue, Jul 6, 2010 at 12:56 AM, sumanta  wrote:

> Now suppose my IP(local) number is 192.168.0.3. how can I create a
> virtual name for the application ? so that I can use www.example.com
> rather http://192.168.03:3000/login_c.

This has nothing to do with Rails; your local DNS needs a record for
the server, with whatever name(s) you choose.

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

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



Re: [Rails] Re: Re: Re: Order form: quantity fields

2010-07-06 Thread Colin Law
On 6 July 2010 12:58, Pale Horse  wrote:
> Colin Law wrote:
>> On 6 July 2010 12:20, Pale Horse  wrote:
>>> 
>>> Products
>>> <% for products in Product.all(:conditions => "display=1") %>
>>>  <%= products.name %> <%= text_field :order, :product_quantity %>
>>> <% end %>
>>> 
>>>
>>> Obviously, the about renders a text field for each Product where the
>>> user can enter the quantity the require opposite a Product name label.
>>
>> Is that inside a form_tag?  It should be text_field_tag I think.
>>
>> Colin
>
> The other text_fields I'm using are working fine with this method.

You did not answer whether it is inside a form_for or form_tag.
Please show the complete form code.

Colin

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



Re: [Rails] Re: About "Rails Recipes", Fowler, 2006

2010-07-06 Thread Juan Pablo Genovese

Richard,

if you don't want to use any plug in and you want to write all the code 
for an authentication solution, but you can't port a 2006 solution to a 
2010 one, you need to get more into Rail's inner workings and understand 
deeply how Rails work. Taking a look at the question you ask at the end 
of your original post, I'd say you're in the right path.
On the other hand, you can try RestfulAuthentication, which generates a 
lot of code (models, views, controllers, tests, and more) in  your app 
(on the contrary of Authlogic - which it doesn't) and take a look at 
that code to understand how it works.
Getting a gasp on Rails might be difficult at the beginning if you have 
experience in other languages / frameworks because of how easy, well 
structured and thought is, but believe me, understanding how Rails works 
will save you a lot of time and work in the future.


--
Mis mejores deseos,
Best wishes,
Meilleurs voeux,

Juan Pablo
--
http://www.twitter.com/eljuanchosf


RichardOnRails wrote:

Hey Marnen,

Suppose someone posted on the Math Forum (if there is such a thing)
the question: what are the roots of the following equation:
6x^2 - 13x + 6 = 0,

I'd respond "3/2 & 2/3", not:
1. use the Quadratic Formula, nor
2. factor the polynomial

After answering the question asked,  I'd probably provide links to
factoring and the Quadratic Formula.

  

Where's the downside?



For this app, we don't want any plug-ins.  Discussing AuthLogic is
secondary.  No one seems interested in helping with the original
question.  Is that because the question is unanswerable, or because
neither of you can answer it with the facts as I presented them?

As Hamlet said so eloquently, "That is the question."

Best,.
Richard

On Jul 5, 9:07 pm, Marnen Laibow-Koser  wrote:
  

RichardOnRails wrote:


Hi Juan & Marnen,
  

Marnen is absolutely right about his suggestion.


You guys may be right about the best way to add authentication to a
Rails app. But that may not be the best way for me to learn Rails
development.
  

It probably is: you can do the easy stuff yourself while learning from
plugins for the hard stuff.  You can look at the plugin code, but in the
meantime you know your app works.  Where's the downside?

  I'll take a look at AuthLogic in due time.  But right



now I'd like some help in fixing a routing problem, so I'm going to
post that question on a separate thread without the context of
authentication.
  
Thanks for your respponses.
  
Best wishes,

Richard
  
On Jul 5, 5:06 pm, Juan Pablo Genovese 
  

--
Posted viahttp://www.ruby-forum.com/.



  


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



  1   2   >