[Rails] Re: Best Practice setup Development environment OS X and Li

2010-01-02 Thread Marnen Laibow-Koser
Dale Ackerman wrote: >> Passenger: Maybe. You'd have to make sure it pointed to the right Ruby. >> >> MySQL: No. The location of the Ruby binary is absolutely irrelevant to >> your DB server. (Again, though, I'd really recommend PostgreSQL instead >> of MySQL.) >> > > Thanks .. I will look a

Re: [Rails] Best Practice setup Development environment OS X and Linux

2010-01-02 Thread Conrad Taylor
On Sat, Jan 2, 2010 at 11:21 PM, Conrad Taylor wrote: > On Sat, Jan 2, 2010 at 11:25 AM, Dale Ackerman wrote: > >> Hi, >> >> I am new to Ruby and Rails (but experienced developer) I use both a >> Linux workstation and MacBook Pro OS X to do development work. I wanted >> to know what the recommen

Re: [Rails] Best Practice setup Development environment OS X and Linux

2010-01-02 Thread Conrad Taylor
On Sat, Jan 2, 2010 at 11:25 AM, Dale Ackerman wrote: > Hi, > > I am new to Ruby and Rails (but experienced developer) I use both a > Linux workstation and MacBook Pro OS X to do development work. I wanted > to know what the recommended setup would be for a flexible development > environment? I

[Rails] Re: Restful routes

2010-01-02 Thread David
An "about us" page is not a candidate for a rest resource. You had it fine before. If you turned your pages controller into a rest resource and moved the "about" page into the resulting cms, then you might create a helper method "about_url" that generates the newly correct url. If you wanted user

[Rails] Re: Best Practice setup Development environment OS X and Li

2010-01-02 Thread Dale Ackerman
> Passenger: Maybe. You'd have to make sure it pointed to the right Ruby. > > MySQL: No. The location of the Ruby binary is absolutely irrelevant to > your DB server. (Again, though, I'd really recommend PostgreSQL instead > of MySQL.) > Thanks .. I will look at PostgreSQL. I have been usin

[Rails] Sessions

2010-01-02 Thread Ralph Shnelvar
The *Agile Web Development with Rails* book has an explanation of sessions that I am having trouble following. Does anyone know of another good discussion of how Rails manages sessions. Specifically, in Firefox and and Internet Explorer ... is each browser window a session? Is each invocation of

[Rails] Re: Best Practice setup Development environment OS X and Li

2010-01-02 Thread Marnen Laibow-Koser
Dale Ackerman wrote: > Nicholas Young wrote: >> Hi Dale, >> >> Previously, I've just used Ruby 1.8.7 and an upgraded copy of the base >> RubyGems install that came with Snow Leopard. However, I wanted to >> take advantage of 1.9.1's speed improvements, and since I'm starting a >> new app, now seem

[Rails] union of two forms in one

2010-01-02 Thread Alberto Lopez
Hello, I have two forms. One of them is for keep the info in BBDD, and the other is to pay in PayPal. In my store I have in tienda_controller.rb an action to checkout. It redirect you to checkout1.html.erb #views/tienda/checkout1.html.erb PASO 1 <%= error_messages_for 'pedido' %> <% form_f

[Rails] Restful routes

2010-01-02 Thread Rong
If I created a route like this map.about '/about', :controller => 'pages', :action => 'about And then added this to a different page <%= link_to "About", about_url %> And decided to change my route to map.resources :about the link to no longer works. What am I doing wrong? -- You received thi

[Rails] Re: Best Practice setup Development environment OS X and Linux

2010-01-02 Thread Dale Ackerman
Nicholas Young wrote: > Hi Dale, > > Previously, I've just used Ruby 1.8.7 and an upgraded copy of the base > RubyGems install that came with Snow Leopard. However, I wanted to > take advantage of 1.9.1's speed improvements, and since I'm starting a > new app, now seemed like the appropriate time

[Rails] webdav

2010-01-02 Thread tom
is anyone using webdav with rails?esp: liverails.net? 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-

[Rails] model in subfolder, not missing constant error

2010-01-02 Thread Corin
Hi all, I'm using the latest rails 2.3.5 and put some models in subfolders like this: models/my/details/texts.rb models/my/details/attributes.rb ... The models themselves are defined like this: class My::Details::Texts < ActiveRecord::Base class My::Details::Attributes < ActiveRecord::Ba

[Rails] Re: Best Practice setup Development environment OS X and Li

2010-01-02 Thread Marnen Laibow-Koser
Nicholas Young wrote: > Hi Dale, > > Previously, I've just used Ruby 1.8.7 and an upgraded copy of the base > RubyGems install that came with Snow Leopard. However, I wanted to > take advantage of 1.9.1's speed improvements, and since I'm starting a > new app, now seemed like the appropriate time

Re: [Rails] has many through & associate records

2010-01-02 Thread Jayoshi
Thanks for the detailed response Conrad, it help me out greatly! Regards, Jayoshi On Fri, Jan 1, 2010 at 7:07 AM, Conrad Taylor wrote: > On Thu, Dec 31, 2009 at 2:06 PM, jayoshi13 wrote: > >> The app I'm building performs Assessments through a series of Tests >> (about 120 tests in total),

[Rails] Re: Underscore in a model's method causes it not to be called from the form helper

2010-01-02 Thread Frederick Cheung
On Jan 2, 9:50 pm, "wdic...@googlemail.com" wrote: > my Game#pconfig_src method will not be called. > But if I change the method's name to 'pconfigsrc' and the symbol's > name accordingly, then it is called. > Why? > Well when the method name is called pconfigsrc then there's no clash with the ac

[Rails] Re: rendering partial chokes on :locals

2010-01-02 Thread Frederick Cheung
On Jan 2, 5:21 pm, Laim Bee wrote: > Frederick Cheung wrote: > The New Comment form displays ok on the front page (I just took the new > view from the comments controller moved a copy of it into my blogs > view). I then rendered it as a partial. When I click on the "Create" > button, I get a 404

[Rails] Re: Re: Re: Simple facebook status update from rails?

2010-01-02 Thread comopasta Gr
> And it can be found here in the FB site: > http://lukaszpelszynski.blogspot.com/2009/09/facebook-rest-api-hackers-way.html Sorry wrong link, this was the good one: http://wiki.developers.facebook.com/index.php/User:Ruby -- Posted via http://www.ruby-forum.com/. -- You received this message b

[Rails] Re: Re: Re: Simple facebook status update from rails?

2010-01-02 Thread comopasta Gr
Hi, I'm not sure if there's actually any issues using the php approach. In the facebook site itself there is a link to the same approach but with ruby. The link points to this: http://lukaszpelszynski.blogspot.com/2009/09/facebook-rest-api-hackers-way.html And it can be found here in the FB site

[Rails] Underscore in a model's method causes it not to be called from the form helper

2010-01-02 Thread wdic...@googlemail.com
Hi, I'm using rails 2.3.5 and found following behavior, which I can't explain. Maybe someone can. I have a model named 'Game'. Its database schema contains a field named 'pconfig_src'. I want to lazy load the pconfig_src value, so added following method to the model: def pconfig_src read_att

[Rails] Re: Best Practice setup Development environment OS X and Linux

2010-01-02 Thread Nicholas Young
Hi Dale, Previously, I've just used Ruby 1.8.7 and an upgraded copy of the base RubyGems install that came with Snow Leopard. However, I wanted to take advantage of 1.9.1's speed improvements, and since I'm starting a new app, now seemed like the appropriate time to switch, and start writing for t

[Rails] Namespaced Controller and Model Access

2010-01-02 Thread Nicholas Young
Hi everyone, I'm building a CMS-y app, and wanted to namespace my admin controllers, ex. "admin/pages/new". However, it appears that I can't get to my models, which are just in the general /app/models directory. Whenever I try to call a model, I get an Uninitialized Constant error... I've seen Rad

[Rails] Re: Best Practice setup Development environment OS X and Lin

2010-01-02 Thread Marnen Laibow-Koser
Dale Ackerman wrote: > > > Thank you for the reply. It is good to know that 1.8.7 is O.K. So Just > use > WEBrick for development then? That's what I do. If I had a dedicated dev machine, I might put Passenger on it. > > There are so many releases and not much in the way of info on what t

[Rails] Re: Best Practice setup Development environment OS X and Lin

2010-01-02 Thread Dale Ackerman
Thank you for the reply. It is good to know that 1.8.7 is O.K. So Just use WEBrick for development then? There are so many releases and not much in the way of info on what to start with. I guess I will remove the RVM package from my mac. Oh I do have a Ubuntu Linux machine would it be rec

[Rails] Re: Best Practice setup Development environment OS X and Lin

2010-01-02 Thread Marnen Laibow-Koser
Marnen Laibow-Koser wrote: [...] > You're overcomplicating things. My setup: > MacBook Pro -- Apple's Ruby 1.8.7 (installed as part of Apple's dev > tools), appropriate gems, KomodoEdit, iTerm, Fink. > Typical server: Ubuntu, Passenger, Ruby Enterprise Edition, either Nginx > or Apache. > > Thi

[Rails] Re: Best Practice setup Development environment OS X and Lin

2010-01-02 Thread Marnen Laibow-Koser
Dale Ackerman wrote: > Hi, > > I am new to Ruby and Rails (but experienced developer) I use both a > Linux workstation and MacBook Pro OS X to do development work. I wanted > to know what the recommended setup would be for a flexible development > environment? What sort of flexibility do you wan

[Rails] Best Practice setup Development environment OS X and Linux

2010-01-02 Thread Dale Ackerman
Hi, I am new to Ruby and Rails (but experienced developer) I use both a Linux workstation and MacBook Pro OS X to do development work. I wanted to know what the recommended setup would be for a flexible development environment? I see there are many releases of ruby and rails. So I have setup rv

[Rails] Re: How to explore the environment?

2010-01-02 Thread Fritz Trapper
Thanks, now it works as expected. -- 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 emai

[Rails] Print a PDF directly after prawnto with iframes

2010-01-02 Thread Juan Kinunt
Hi, I think I'm very near of accomplishing this but I have a problem. This is the code: <%- content_for :head do -%> function printPDF(){ var pdf = document.getElementById("pdfDoc").contentWindow; pdf.focus(); pdf.print(); } <%- end -%> <%= link_to 'Print', {:co

[Rails] Re: How to explore the environment?

2010-01-02 Thread pharrington
On Jan 2, 12:32 pm, Fritz Trapper wrote: > pharrington wrote: > > On Jan 2, 11:19 am, Fritz Trapper wrote: > >> format.xml { render :xml => @zaehlers } > >> end > >> end > > > Look at this carefully. You're closing the respond_to block, and then > > closing the index method. keineZaehlerVorhanden

[Rails] Re: How to explore the environment?

2010-01-02 Thread Fritz Trapper
pharrington wrote: > On Jan 2, 11:19�am, Fritz Trapper wrote: >> � � � format.xml �{ render :xml => @zaehlers } >> � � end >> � end > > Look at this carefully. You're closing the respond_to block, and then > closing the index method. keineZaehlerVorhanden isn't a class method, > so of course the

[Rails] Re: rendering partial chokes on :locals

2010-01-02 Thread Laim Bee
Frederick Cheung wrote: > On Dec 28, 3:56�am, Laim Bee wrote: >> I also tried creating a new Note in the production environment (using >> ruby script/server production) and got the following error (See below). >> It looks like a table doesn't exist? Is it possible that when I >> db:migrate 'd my t

[Rails] Re: How to explore the environment?

2010-01-02 Thread pharrington
On Jan 2, 11:19 am, Fritz Trapper wrote: > One more issue. > > class ZaehlersController < ApplicationController >   def index >     if keineZaehlerVorhanden >        blah >     end > >     respond_to do |format| >       format.html # index.html.erb >       format.xml  { render :xml => @zaehlers

[Rails] Re: How to explore the environment?

2010-01-02 Thread Fritz Trapper
I forgot to say: keineZaehlerVorhanden is defined in ApplicationHelper, which is included 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 em

[Rails] Re: How to explore the environment?

2010-01-02 Thread Fritz Trapper
One more issue. class ZaehlersController < ApplicationController def index if keineZaehlerVorhanden blah end respond_to do |format| format.html # index.html.erb format.xml { render :xml => @zaehlers } end end if !keineZaehlerVorhanden verify :session

Re: [Rails] Re: will_paginate resulting in server 500 error...

2010-01-02 Thread Peter De Berdt
On 02 Jan 2010, at 16:53, RubyonRails_newbie wrote: >> What do you mean by root? > > When i log onto my vhost, there is a root folder. > > Should it be installed here, or actually where my app resides? > > May be a daft question - sorry! :-) Instead of messing around, just freeze all the gems an

[Rails] Re: How to explore the environment?

2010-01-02 Thread Fritz Trapper
pharrington wrote: > Just curious now; what version of Rails did you have previously > installed, and what version did you upgrade to before running rake > rails:update? I initially installed ruby and rails using synaptic on Ubuntu 9.04. It was ruby 1.8 and rails 2.1.0-6. -- Posted via http://ww

[Rails] Re: Named Scopes and Created At

2010-01-02 Thread chris.reis...@gmail.com
Sorry I have no time to test this, but try this: named_scope :recently_published, :conditions => { :published => true }, :order => 'posts.created_at DESC' I am pretty sure you can be specific about the table in this case. CowboyonRails Chris Reister On Jan 1, 5:34 pm, jm wrote: > I am using na

Re: [Rails] Encrypt senders pvtkey with data and with recievers pubkey

2010-01-02 Thread Curtis Jennings Schofield
werd. thanks Aaron - I appreciate your response. On Fri, Jan 1, 2010 at 4:22 PM, Aaron Turner wrote: > You would store the key(s) on disk- just like the OP.   Usually this > is done in the PGP keyring. > > Who's key you would use depend on who you're encrypting the file to & > who you are signi

[Rails] Re: will_paginate resulting in server 500 error...

2010-01-02 Thread RubyonRails_newbie
> What do you mean by root? When i log onto my vhost, there is a root folder. Should it be installed here, or actually where my app resides? May be a daft question - sorry! :-) On 2 Jan, 13:16, Frederick Cheung wrote: > On Jan 2, 11:15 am, RubyonRails_newbie > wrote: > > > I think will_pagina

[Rails] Re: How to explore the environment?

2010-01-02 Thread pharrington
On Jan 2, 10:15 am, Fritz Trapper wrote: > rake rails:update Then perhaps helper() actually included the helper modules into the controller in an earlier version of Rails. Its hard for me to remember at this point, but I know since at least 2.2 helper()'s behaved as it does now. Just curious now

[Rails] Re: How to explore the environment?

2010-01-02 Thread Fritz Trapper
But there is still one annoying point: My controllers worked using methods from ApplicationHelper until yesterday morning, when I tried to modify routes.rb and run sume rake jobs from RadRails that I didn't really understand, including rake rails:update The changes in routes.rb have been rolle

[Rails] Re: How to explore the environment?

2010-01-02 Thread Fritz Trapper
pharrington wrote: > As I said: ActionController::Base.helper does not actually include > helper modules into the controller; it makes them accessible in the > view. You'll need to > > include ApplicationHelper # or whatever appropriate module > > to have the methods accessible in the controll

[Rails] Re: How to explore the environment?

2010-01-02 Thread pharrington
On Jan 2, 8:37 am, Fritz Trapper wrote: > Thanks for your replies. > > Now I read the API reference of ActionController::Helpers::ClassMethods > and took a look into my ApplicationController, which has been generated > via RadRails: > > class ApplicationController < ActionController::Base >   help

Re: [Rails] create subform within rails form

2010-01-02 Thread Conrad Taylor
On Sat, Jan 2, 2010 at 4:45 AM, Ahmed Abdelsalam wrote: > Hi, > > I have a form for a model that have relationship to other models in my > application. For example, a company and employees. When I add new > employee, I should select company for which employee is working. How > about if the employe

[Rails] Re: How to explore the environment?

2010-01-02 Thread Fritz Trapper
Thanks for your replies. Now I read the API reference of ActionController::Helpers::ClassMethods and took a look into my ApplicationController, which has been generated via RadRails: class ApplicationController < ActionController::Base helper :all # include all helpers, all the time protec

[Rails] Re: will_paginate resulting in server 500 error...

2010-01-02 Thread Frederick Cheung
On Jan 2, 11:15 am, RubyonRails_newbie wrote: > I think will_paginate is installed.. should I be checking this in gem > list --remote ? --remote means it searches for gems on the gem servers - not relevant here. > > Presumably installed at root level too? What do you mean by root? Fred > > Id

Re: [Rails] create subform within rails form

2010-01-02 Thread Dhruva Sagar
Hi, I am doing just that in my application. First I would like to give you a heads up that HTML does not work well with nested FORMS, at least the browsers do not. So you will have to ensure that the forms aren't nested, you can still make them appear nested / subforms by using relative positioni

[Rails] create subform within rails form

2010-01-02 Thread Ahmed Abdelsalam
Hi, I have a form for a model that have relationship to other models in my application. For example, a company and employees. When I add new employee, I should select company for which employee is working. How about if the employee works in a company that is not in my database? so I want to create

[Rails] Re: Test for field validation before saving

2010-01-02 Thread Álvaro Morais
Yes it helps. Thank you. Love your sig. On Jan 2, 11:06 am, Leonardo Mateo wrote: > On Fri, Jan 1, 2010 at 7:53 PM, Álvaro Morais wrote: > > Hi. I'm new to rails, and I must say I'm loving it. > > I have a question that some of you may already found the answer. > > > Here's the problem > > I've

[Rails] Re: will_paginate resulting in server 500 error...

2010-01-02 Thread RubyonRails_newbie
I think will_paginate is installed.. should I be checking this in gem list --remote ? Presumably installed at root level too? Id best take another peek... Thanks for the response... On Jan 1, 10:48 pm, Frederick Cheung wrote: > On Jan 1, 6:43 pm, RubyonRails_newbie > wrote: > > > > > When I l

Re: [Rails] Ruby Gems Start up troubles

2010-01-02 Thread Leonardo Mateo
On Fri, Jan 1, 2010 at 11:06 PM, cmw237 wrote: > I am having a rough go at installing rubygems.  I don't know where to > place the files upon download and the appropriate diction would be to > call on it.  However in the mean time I am getting more frustrated by > finding out the possibilities of

Re: [Rails] Test for field validation before saving

2010-01-02 Thread Leonardo Mateo
On Fri, Jan 1, 2010 at 7:53 PM, Álvaro Morais wrote: > Hi. I'm new to rails, and I must say I'm loving it. > I have a question that some of you may already found the answer. > > Here's the problem > I've made a simple user signup interface that sends a confirmation > link to the email of the link.

[Rails] Ruby Gems Start up troubles

2010-01-02 Thread cmw237
I am having a rough go at installing rubygems. I don't know where to place the files upon download and the appropriate diction would be to call on it. However in the mean time I am getting more frustrated by finding out the possibilities of having it installed. Also what would be the best envir

[Rails] Test for field validation before saving

2010-01-02 Thread Álvaro Morais
Hi. I'm new to rails, and I must say I'm loving it. I have a question that some of you may already found the answer. Here's the problem I've made a simple user signup interface that sends a confirmation link to the email of the link. The problem is that I want to confirm if everything is ok before

[Rails] Re: Named Scopes and Created At

2010-01-02 Thread Frederick Cheung
On Jan 2, 1:34 am, jm wrote: > Everything works as expected except the created_at attribute for my > posts. When I print the created at timestamp in the view, it is > actually printing the created timestamp for the tag. > > <%= post.created_at.strftime('%B %d, %Y') %> gives me the created at >

Re: [Rails] authlogic with declarative authorization

2010-01-02 Thread Rails ROR
Hello I have only 2 roles 1. admin and the other is the author This is my authorization_roles.rb file role :author, :title => "Author" do description "The default role for Author" has_permission_on [:publishers,:subjects,:courses], :to => [:new, :create,:show] end role :admin do ha