[Rails] Re: Interesting Class variable problem

2009-04-27 Thread Frederick Cheung
On Apr 27, 11:49 pm, Commander Johnson wrote: > class PostOfTheDay >   private > >   def self.current_day >     DateTime.now.utc.to_date >   end > >   @@current_post = nil >   @@current_day = current_day > >   def self.get_random_post >     posts = Post.all > >     posts[rand(posts.size)] >   e

[Rails] Re: Migrating rails 2.2.2 to 2.3.2

2009-04-27 Thread Commander Johnson
Oh and don't forget rake rails:update! On Tue, Apr 28, 2009 at 8:54 AM, Commander Johnson < commanderjohn...@gmail.com> wrote: > Hi Don, > > This document helped me to migrate from 2.1 to 2.3: > > http://guides.rubyonrails.org/2_3_release_notes.html > > I also found a Google search on 'rails 2.3

[Rails] Re: what's the easiest way for novice to install RoR

2009-04-27 Thread Sergio Footenko
Hi Try book recomended for me in this forum http://www.ruby-forum.com/topic/185496#new It is really, very very good book -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[Rails] Re: what's the easiest way for novice to install RoR

2009-04-27 Thread Commander Johnson
Hi Sumon, I recommend that you start in Windows (because that is your most familiar environment) using RubyStack: http://bitnami.org/stack/rubystack RubyStack is like WAMP for Ruby. When you're comfortable with it, switch to Linux because it will run much faster. CmdJohnson On Tue, Apr 28, 200

[Rails] Re: Rails2 Documetation.

2009-04-27 Thread Sergio Footenko
I have Rails 2.3.2 I'll buy this book today, and I like this tutorials that you adviced. Thanks you. But I'd be happy see many more advices =)) -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] what's the easiest way for novice to install RoR

2009-04-27 Thread Sumon
hi, i am fairly novice in RoR. Even i don't have clear idea of RoR. but i am highly interested to learn RoR. i have some experience in php (mostly windows environment). so far i understand, RoR is best with linux. well, i have fedora 10 installed. php,mysql and apache2 is also installed. i am abl

[Rails] Re: What is 'Representational State Transfer'?

2009-04-27 Thread Robert Walker
David A. Black wrote: > Hi -- > > Robert Walker wrote: >> >> Representational: >> The web consists of resources in the form of web pages that are >> represented using a Uniform Resource Identifier (URI). REST extends this >> definition to refer to other types of resources of an application (i.e.

[Rails] Re: Rails2 Documetation.

2009-04-27 Thread Conrad Taylor
On Mon, Apr 27, 2009 at 9:03 PM, Sergio Footenko < rails-mailing-l...@andreas-s.net> wrote: > > Hello ! > > I started to learn the ruby on rails 2(!) and I have many problems with > documentation. I'm new in this, and I don't know difference between 1x > and 2x versions of rails, oh , yes, I can

[Rails] Rails2 Documetation.

2009-04-27 Thread Sergio Footenko
Hello ! I started to learn the ruby on rails 2(!) and I have many problems with documentation. I'm new in this, and I don't know difference between 1x and 2x versions of rails, oh , yes, I can see difference after seen error messages in firefox, removing this documentation, and adding this sites

[Rails] Problem with SEO urls and the Find_By_ID() not working

2009-04-27 Thread Steve Shephed
I have a problem where the app I am developing uses SEO friendly urls using the to_params method. When using the the finder method find_by_id('13-Some-other-text') it is not finding the record. The record is there. If I put a to_i() on the value it works fine. I thought ActiveRecord did this aut

[Rails] Introducing Pfeed plugin, automagically create fancy logs / activity updates in your rails app

2009-04-27 Thread abhishek.parolkar
Hey All! I just pushed a plugin that brings little more simplicity to the way we create customizable logs, either for implementing activity feed feature or logging for monitoring purposes. Let me know your thoughts. Though, there is little documentation, it should be enough for people to get st

[Rails] Migrating rails 2.2.2 to 2.3.2

2009-04-27 Thread Don French
I tried to just change the rails gem I use with my application and I got the following error: /usr/local/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/core_ext/module/aliasing.rb:33:in `alias_method': undefined method `template_exists?' for class `ActionController::Base' (Nam

[Rails] Re: Travel Salesman Problem

2009-04-27 Thread Arthur Chan
Thanks guys, I kinda understood the basic idea of the TSP. i wanna do something like heuristic functions. Or, something like: http://www.ruby-forum.com/topic/127031#new I don't know if the "grid" method mentioned is applicable for general TSP. Thanks again. Robert Anderson wrote: > I said s

[Rails] Re: Asynchronous SSH tasks

2009-04-27 Thread Paul Denize
Found the solution ssh_session = Net::SSH.start(...etc...) sftp_conn = ssh_session.sftp.connect! # needed to block connect here (!) or the upload seems to hang sftp_conn.upload(src_file, tgt_file) interrupted = false trap('INT') { interrupted = true } sftp_conn.loop() { not interrupted a

[Rails] Re: Asynchronous copies

2009-04-27 Thread pdenize
Found the solution ssh_session = Net::SSH.start(...etc...) sftp_conn = ssh_session.sftp.connect! # needed to block connect here (!) or the upload seems to hang sftp_conn.upload(src_file, tgt_file) interrupted = false trap('INT') { interrupted = true } sftp_conn.loop() { not interrupted an

[Rails] Re: if...elseif...else, broken; need help

2009-04-27 Thread Brendon
Perhaps using elsif instead of elseif will help. But your code makes no attempt to return a value, so the nil is expected. If you are planning on returning a value, do something like this: result = if person == "Somebody" "foo" elsif person == "Another" "else if returned" else "no match" en

[Rails] Re: Find eager loads correct records but generates excess queries (Rails 2.1)

2009-04-27 Thread davidy
All SQL queries are generated by that one, single find() call. This is really scary -- there is nothing in the documentation to suggest that it can do this kind of "fake join", or the performance impact it can have. Sorry about the anonymisation, but the real table names would only confuse things

[Rails] Re: Is Amazon s3 always this slow?

2009-04-27 Thread Sanuk Mak
Chris Olsen wrote: > I made some changes to prevent accessing all the files through an ssl > connection, but it is still at about 3 seconds to download. (Actually > the files are missing on the s3 server so it is really taking three > seconds to find out that the files are not there). > > The Rig

[Rails] Re: Writing a plugin: Need to get including class's name. Help?

2009-04-27 Thread Chris Johnson
Chris Johnson wrote: > Hello. > > For reference, here is some sample code that exemplifies what I am > trying to do: > http://gist.github.com/102816 > > I am trying to dynamically defined a class, whose name is either passed > in as a parameter or based on the including class name. > > So if I

[Rails] Re: Controller Instance Variables

2009-04-27 Thread djolley
> Is this something that you can do with a before_filter? I think you may be onto something. Conceptually, it sounds like your suggestion should work. I'm just not sure that I know how to go about implementing it. I'll play around with the concept and post if I am successful. In the meantime,

[Rails] google adsense breaks render :partial =>

2009-04-27 Thread Richard Schneeman
Hey everybody, i've got a control that returns a partial, no biggie. Except when that partial contains the javascript for my adsense account. Then the partial renders correctly, and then quickly replaces my page with nothing by the ad. When i take away my adsense js, everything works great. Has an

[Rails] Re: Controller Instance Variables

2009-04-27 Thread djolley
> I am having difficulty imagining why you would want an instance variable of > a controller that is not associated with an action, what else do controllers > do? The thing is that this particular instance variable is associated with *ALL* of the actions of the controller. I want to be DRY and o

[Rails] Asynchronous SSH tasks

2009-04-27 Thread Paul Denize
I have managed to get copies working well between Windows and Linux but I noticed that the libraries allow Asynchronous operation. I can send Async commands and the loop till they complete but copies seem to stay busy forever. Maybe I am just not cleaning up right (it does not seem so) ssh_sess

[Rails] Writing a plugin: Need to get including class's name. Help?

2009-04-27 Thread Chris Johnson
Hello. For reference, here is some sample code that exemplifies what I am trying to do: http://gist.github.com/102816 I am trying to dynamically defined a class, whose name is either passed in as a parameter or based on the including class name. So if I had something like this: class Green; act

[Rails] Re: validators.rb breaks after update from Rails 2.2.2 to 2.3.2

2009-04-27 Thread Matt Jones
My guess would be some change to the load order - you'd be better off loading your custom validations in an initializer, so that ActiveRecord is loaded. --Matt Jones On Apr 26, 5:22 am, John Mackin wrote: > I just updated my rails application from 2.2.2 to 2.3.2 and the > following message is

[Rails] Re: Submit form through GET requets

2009-04-27 Thread Cisco Ri
Cisco Ri wrote: > I'm going ahead with: > > @link = @user.links.create!("url" => params[:url]) > > I also changed my routes.rb file to include these lines: > # map.resources :links > map.resources :users, :has_many => :links > > It works, but I'm still having some trouble. With these lines

[Rails] Different links after refresh

2009-04-27 Thread Cisco Ri
I have a couple of links that appear via Ajax. <%= link_to 'Edit', url_for(:controller => :links, :action => "edit", :id => link.id) %> | <%= link_to 'Destroy', url_for(:controller => :links, :action => "destroy", :id => link.id) %> After their appearance, they go to http://localhost:3000/users/

[Rails] Re: Submit form through GET requets

2009-04-27 Thread Cisco Ri
I'm going ahead with: @link = @user.links.create!("url" => params[:url]) I also changed my routes.rb file to include these lines: # map.resources :links map.resources :users, :has_many => :links It works, but I'm still having some trouble. With these lines @link = @user.links.create!(

[Rails] Interesting Class variable problem

2009-04-27 Thread Commander Johnson
class PostOfTheDay private def self.current_day DateTime.now.utc.to_date end @@current_post = nil @@current_day = current_day def self.get_random_post posts = Post.all posts[rand(posts.size)] end public def self.fetch if @@current_post.nil? || @@current_day !

[Rails] Re: What is 'Representational State Transfer'?

2009-04-27 Thread David A. Black
Hi -- Robert Walker wrote: > Amita Bhatkhande wrote: >> I have read about REST, but never really understood meaning of >> 'Representational State Transfer'. I tried to read Fielding's >> dissertation, but did not understand this term and why has he used it. >> What does it mean? Which state? What

[Rails] Too Many Rooms for Rubyconf

2009-04-27 Thread Marz
Booked 4 Rooms we aren’t going to use, walking distance to the Conference. Four nights: Sunday 5-3-09 through Wednesday 5-6-09. Willing to let them go for about HALF the price of the Hilton. Call Martin at 760-237-4054. --~--~-~--~~~---~--~~ You received this mess

[Rails] Re: Passing multiple values with link_to

2009-04-27 Thread Frederick Cheung
On Apr 27, 10:57 pm, DVG wrote: > Okay, so I have a many-to-many relationship between Users and Groups. > When looking at the Group, I have the user rows being rendered via a > partial. I want to have a "Remove" link next to each user name in > turn, which calls the "remove user from group" act

[Rails] Passing multiple values with link_to

2009-04-27 Thread DVG
Okay, so I have a many-to-many relationship between Users and Groups. When looking at the Group, I have the user rows being rendered via a partial. I want to have a "Remove" link next to each user name in turn, which calls the "remove user from group" action, but I'm unsure how exactly to specify

[Rails] Re: Error following the 15 minute blog with ROR Screen cast

2009-04-27 Thread Frederick Cheung
On Apr 27, 9:33 pm, Tommo wrote: > 1: <% div for @post do %> You've got a typo here - it should be div_for Fred --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,

[Rails] Ruby on Rails Developers

2009-04-27 Thread irenka
Cubiware jest spółka zajmująca się tworzeniem oprogramowania dla urządzeń interaktywnej telewizji cyfrowej oraz internetowej. Firma współpracuje z klientami i partnerami zagranicznymi, a nasze oprogramowanie jest używane w USA, krajach europy zachodniej oraz w Azji. Naszymi Klientami są producenci

[Rails] Error following the 15 minute blog with ROR Screen cast

2009-04-27 Thread Tommo
Hello Everyone, I was following this screen cast: http://media.rubyonrails.org/video/rails_blog_2.mov and when I got to the part about making a new file, creating a template, and then rendering the partial, I received the following error page: SyntaxError in Posts#show Showing app/views/posts

[Rails] Re: Controller Instance Variables

2009-04-27 Thread Freddy Andersen
Is this something that you can do with a before_filter? --~--~-~--~~~---~--~~ You received 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 unsubscr

[Rails] Re: What is 'Representational State Transfer'?

2009-04-27 Thread Commander Johnson
I for one found this post very useful. On Mon, Apr 27, 2009 at 10:16 PM, Robert Walker < rails-mailing-l...@andreas-s.net> wrote: > > Amita Bhatkhande wrote: > > I have read about REST, but never really understood meaning of > > 'Representational State Transfer'. I tried to read Fielding's > > di

[Rails] Re: ruby jasper report

2009-04-27 Thread Gianluca Tessarolo
Tushar, IMHO Jasper Reports and iReport are great tools. I have built a system with rails 1.1.x and some days ago I've successfully ported it on Rails 2.3.2, all works well (the only gotcha is a little memory leak calling IO.popen (not destructive memory leak), I think the problem is due to Pa

[Rails] Re: deprec problem

2009-04-27 Thread Conrad Taylor
On Mon, Apr 27, 2009 at 1:52 PM, Conrad Taylor wrote: > On Mon, Apr 27, 2009 at 1:37 PM, mahmoud_cs > wrote: > >> >> i deploy my rails application with capistrano and deprec2 to ubuntu >> the username is 'mahmoud' >> but when i deploy this message display >> " connection failed for: 10

[Rails] Re: deprec problem

2009-04-27 Thread Conrad Taylor
On Mon, Apr 27, 2009 at 1:37 PM, mahmoud_cs wrote: > > i deploy my rails application with capistrano and deprec2 to ubuntu > the username is 'mahmoud' > but when i deploy this message display > " connection failed for: 10.0.0.8 > (Net::SSH::AuthenticationFailed: mahmoud) " > what can

[Rails] deprec problem

2009-04-27 Thread mahmoud_cs
i deploy my rails application with capistrano and deprec2 to ubuntu the username is 'mahmoud' but when i deploy this message display " connection failed for: 10.0.0.8 (Net::SSH::AuthenticationFailed: mahmoud) " what can i do? --~--~-~--~~~---~--~~ You

[Rails] Re: What is 'Representational State Transfer'?

2009-04-27 Thread Robert Walker
Amita Bhatkhande wrote: > I have read about REST, but never really understood meaning of > 'Representational State Transfer'. I tried to read Fielding's > dissertation, but did not understand this term and why has he used it. > What does it mean? Which state? What transfer? I'm not sure anyone kn

[Rails] Re: git push doen't change my live application

2009-04-27 Thread Freddy Andersen
BTW here is the Capistrano group http://groups.google.com/group/capistrano On Apr 27, 1:16 pm, Freddy Andersen wrote: > When you say git push? Do you mean an actual git push, or are we > talking cap deploy ? > > If its cap deploy you need to make sure that your application has > restarted. What

[Rails] Re: git push doen't change my live application

2009-04-27 Thread Freddy Andersen
When you say git push? Do you mean an actual git push, or are we talking cap deploy ? If its cap deploy you need to make sure that your application has restarted. What application server is it that you are using? Thin, Mongrel, Apache? On Apr 27, 12:40 pm, "zelop...@gmail.com" wrote: > I am usi

[Rails] Re: Controller Instance Variables

2009-04-27 Thread Colin Law
I am having difficulty imagining why you would want an instance variable of a controller that is not associated with an action, what else do controllers do? Are you sure it is not an instance variable of a model that you should be using? Colin 2009/4/27 djolley > > > Rails does some magic to ma

[Rails] What is 'Representational State Transfer'?

2009-04-27 Thread Amita Bhatkhande
I have read about REST, but never really understood meaning of 'Representational State Transfer'. I tried to read Fielding's dissertation, but did not understand this term and why has he used it. What does it mean? Which state? What transfer? Thanks, Amita. -- Posted via http://www.ruby-forum.co

[Rails] Re: Controller Instance Variables

2009-04-27 Thread djolley
> Rails does some magic to make that happen. Here is a blog post that > explains the basics of how this happens: > > http://www.neeraj.name/blog/articles/719-how-controller-and-view-shar... Thanks. The blog post explains the magic that Rails uses to make the instance variables contained in an ac

[Rails] Re: git push doen't change my live application

2009-04-27 Thread zelop...@gmail.com
I am using dreamhost. All I i want to do is make changes on my application and push them live. Yes I am using capistrano with git. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post t

[Rails] Re: What is the sequential steps of installing RoR?

2009-04-27 Thread Robert Walker
Sazima wrote: > Sheru, > > Forget about Win, go for Linux over a virtual machine, for example > Ubuntu running on Sun xVM VirtualBox. It's way easier, faster, better! > > Cheers, Sazima +1 Go Linux/UNIX and experience all the Ruby on Rails goodness without the hassle. -- Posted via http://ww

[Rails] Re: Submit form through GET requets

2009-04-27 Thread 7stud --
Cisco Ri wrote: >> >> Completely bypassing the form would be >> nice. >> Did you try this: > Here's something that worked for me: > > 1) Create a new controller and action that the user will enter as the > url: > > $ ruby script/generate controller direct entry > > That creates a controll

[Rails] Re: Controller Instance Variables

2009-04-27 Thread Robert Walker
7stud -- wrote: > Doug Jolley wrote: > Perhaps a more basic question is: why is the template able to access the > private variables in the controller at all? In other words, if you > define a ruby class like this: Rails does some magic to make that happen. Here is a blog post that explains th

[Rails] Re: Controller Instance Variables

2009-04-27 Thread 7stud --
Doug Jolley wrote: > Values of instance variables set within an action of a controller are > available in the template associated with that action. I was thinking > (hoping?) that the values of instance variables set within a > controller but outside of any action would be universally available t

[Rails] Re: Renaming a file inside a zip

2009-04-27 Thread Franco Catena
There is no method to directly rename a directory, you must use the rename in every file between the directory like this: Zip::ZipFile.open('my.zip') do |zipfile| zipfile.file.rename 'original_dir/orignal_name.txt', 'new_dir/ original_name.txt' end And after that you can remove the original di

[Rails] Re: downgrade ruby from 1.8.7 to 1.8.6 under debian

2009-04-27 Thread Neal Harmon
ChangleWEi, Thank you for taking time to post this. Solved all kinds of problems for me. -- 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

[Rails] how to get acts_as_versioned able to delete only selected version

2009-04-27 Thread oz4...@gmail.com
Hello everyone i'm working on uploading file by using attachment_fu and acts_as_versioned so the problem is i can't delete only selected version for example ; i have file a.txt and this file have 5 version each version is viewable ( that mean you can view version 1 , version 2 , version 3 .

[Rails] Re: Controller Instance Variables

2009-04-27 Thread Frederick Cheung
On 27 Apr 2009, at 17:23, doug wrote: > > Values of instance variables set within an action of a controller are > available in the template associated with that action. I was thinking > (hoping?) that the values of instance variables set within a > controller but outside of any action would be

[Rails] Re: ruby jasper report

2009-04-27 Thread LaughingNinja
What do you recommend for reports using Rub?. I looked into ruport and it seems very clunky and from what I read is dying. On Apr 27, 7:00 am, InventoryTrackers wrote: > Tushar, > I spent about a month trying to get iReport and JasperReports working > with Rails and it is just a ridiculous fit.

[Rails] Re: routes, controllers, and intentions

2009-04-27 Thread Ar Chron
With default routing in place, it would seem to me to be something on the order of the following, given courses, students, and rosters: course has_many rosters has_many students through rosters student has_many rosters has_many courses through rosters roster belongs_to course bel

[Rails] Re: Renaming a file inside a zip

2009-04-27 Thread elioncho
I copied a wrong code, here it is. As I say before it only works for renaming the file not the folder. Zip::ZipFile.open('/home/elioncho/Desktop/MyApp.zip'){|zf| parent_folder = zf.get_entry('Test/') file = zf.get_entry('Test/build.yml') parent_folder.name = 'Testing/'

[Rails] Re: Renaming a file inside a zip

2009-04-27 Thread elioncho
Hi Franco, Thanks for your reply, but still it ain't working for. I need to rename a folder not a file. It works fine for file but not for folders. I tried this and it correctly renamed the file build.yml to builder.yml, BUT the folder wasn't rename, instead it created a new folder in the same le

[Rails] how to get acts_as_versioned able to delete only selected ve

2009-04-27 Thread Preeda Payattakool
Hello everyone i'm working on uploading file by using attachment_fu and acts_as_versioned so the problem is i can't delete only selected version for example ; i have file a.txt and this file have 5 version each version is viewable ( that mean you can view version 1 , version 2 , version 3 .

[Rails] Re: Renaming a file inside a zip

2009-04-27 Thread Franco Catena
You must require 'zip/zipfilesystem' and Zip::ZipFile.open('my.zip') do |zipfile| zipfile.file.rename 'orignal_name.txt', 'new_name.txt' end And this is it, for more information see the Zip::ZipFileSystem class documentation. Regards. Franco Catena. On Apr 27, 12:12 pm, elioncho wrote: > H

[Rails] Controller Instance Variables

2009-04-27 Thread doug
Values of instance variables set within an action of a controller are available in the template associated with that action. I was thinking (hoping?) that the values of instance variables set within a controller but outside of any action would be universally available to all the templates associa

[Rails] Re: Serving formats at named route?

2009-04-27 Thread Vapor ..
Colin Law wrote: > Do you need /abc.:format in routes.rb for this? Great, thanks! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to t

[Rails] Re: Serving formats at named route?

2009-04-27 Thread Colin Law
Do you need /abc.:format in routes.rb for this? 2009/4/27 Vapor .. > > I am using a named route, like /abc. > I have put... > > respond_to do |format| > format.html > format.json (render :json => @variable) > end > > in method. > > But when I do /abc.json, it doesn't work. > Any hints? > Thanks.

[Rails] Serving formats at named route?

2009-04-27 Thread Vapor ..
I am using a named route, like /abc. I have put... respond_to do |format| format.html format.json (render :json => @variable) end in method. But when I do /abc.json, it doesn't work. Any hints? Thanks. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~-

[Rails] Re: Legacy encryption function...

2009-04-27 Thread Alex
Works. Thank you for your help! On Apr 27, 11:23 am, Frederick Cheung wrote: > On Apr 27, 4:02 pm, Alex wrote: > > > > > > > Hello everyone, I have an old Java authentication web service that I > > must use in my rails development. The service takes a username and an > > encrypted password. I'm

[Rails] Re: Legacy encryption function...

2009-04-27 Thread Frederick Cheung
On Apr 27, 4:02 pm, Alex wrote: > Hello everyone, I have an old Java authentication web service that I > must use in my rails development. The service takes a username and an > encrypted password. I'm having trouble reproducing the same encryption > algorithm. > > Here is the Java encryption fu

[Rails] Renaming a file inside a zip

2009-04-27 Thread elioncho
Hello, Can anyone help me or give me any clue on how to rename a file (or folder) inside a zip file without having to unzip it first. I'm trying to do this using the rubyzip gem without luck. Thanks, Elías --~--~-~--~~~---~--~~ You received this message because y

[Rails] Legacy encryption function...

2009-04-27 Thread Alex
Hello everyone, I have an old Java authentication web service that I must use in my rails development. The service takes a username and an encrypted password. I'm having trouble reproducing the same encryption algorithm. Here is the Java encryption function: public static String digest(String t

[Rails] Creating & Validating w/ has_many :through

2009-04-27 Thread Eric Milford
I don't have a full grasp on has_many :through associations. I've detailed my models below and am trying to figure out how to do the following in the proper manner. 1. Add the selected software (only one selectable) to the current ticket. I have @ticket.software << @software working just fine.

[Rails] Adding and validating with has_many :through

2009-04-27 Thread ericindc
I don't have a full grasp on has_many :through associations. I've detailed my models below and am trying to figure out how to do the following in the proper manner. 1. Add the selected software (only one selectable) to the current ticket. I have @ticket.software << @software working just fine.

[Rails] Re: reset_sessions how to?

2009-04-27 Thread Colin Law
Possibly you could do it by changing the secret on starting the server up rather than when killing it off. Colin 2009/4/27 vimal > > I have tried it before and got the same as you said. > > >You can > >invalidate it by changing your session's secret (make sure you deal > >with the exception that

[Rails] Re: Modern Form Tutorials?

2009-04-27 Thread Tim Lowrimore
You'll probably want to have a look at this: http://github.com/alloy/complex-form-examples/tree/master The code is fairly straight-forward, and it was written by the guy who introduced the new accepts_nested_attributes_for functionality into rails. Cheers, Tim On Mon, Apr 27, 2009 at 6:43 AM, DV

[Rails] Re: Find eager loads correct records but generates excess queries (Rails 2.1)

2009-04-27 Thread Frederick Cheung
On Apr 27, 3:18 pm, davidy wrote: > Models: >   S :has_many F; F :belongs_to P; S :has_many P :through F. > > Query looks like this: >   S.find_all_by_key([array of keys], :include => [:F, :P]) > > This produces the correct and expected result, but very slowly. On the > log: > SELECT * FROM S W

[Rails] Re: How do I properly create a menu with optgroup labels?

2009-04-27 Thread Jim Burgess
In case this helps anyone else, I now have: form_controller.rb: def index @members_group = [ ["Molecular Neuroscience", [["Prof. Dr. Denise Manahan-Vaughan", "1"], ["Prof. Dr. Lutz Pott", "2"]]], ["Developmental Neuroscience", [["Prof. Dr. Petra Wahle", "3"], ["Prof. Dr. Andreas Faissner", "4"

[Rails] Find eager loads correct records but generates excess queries (Rails 2.1)

2009-04-27 Thread davidy
Models: S :has_many F; F :belongs_to P; S :has_many P :through F. Query looks like this: S.find_all_by_key([array of keys], :include => [:F, :P]) This produces the correct and expected result, but very slowly. On the log: SELECT * FROM S WHERE KEY IN (keys) SELECT * FROM F WHERE S_ID IN (S.i

[Rails] Re: Travel Salesman Problem

2009-04-27 Thread Robert Anderson
I said start here, no finish here :) -- Robert Anderson Nogueira de Oliveira _ Tribunal de Justiça do Estado de Sergipe Graduando em Sistemas de Informação - UNIT MSN: ranophoe...@hotmail.com "Ausência de evidência não é evidência de ausência." (Carl Sagan) On Mon, Apr

[Rails] Re: Travel Salesman Problem

2009-04-27 Thread Jarl Friis
Robert Anderson writes: > 1. (*) text/plain ( ) text/html > > Start here: > > http://en.wikipedia.org/wiki/A*_search_algorithm This algorithm finds shortest path from initial node to goal node. TSP (Traveling SalesMan) is aobut visiting all nodes in a graph. Solving the TS

[Rails] Re: ruby jasper report

2009-04-27 Thread InventoryTrackers
Tushar, I spent about a month trying to get iReport and JasperReports working with Rails and it is just a ridiculous fit. Firstly, I identified ONE PERSON who had actually got this working in Helena Montana and he strongly cautioned me to avoid this approach at all costs. Secondly, in the reports

[Rails] Re: How do I properly create a menu with optgroup labels?

2009-04-27 Thread Jim Burgess
> you need to tell grouped_options_for_select what the value of the > selected option is > > Fred Wonderful. I checked the documenttation for grouped_options_for_select again, and you are completely right. It's done with the use of selected_key. The code now reads: <%= select_tag "applicant[me

[Rails] Re: How do I properly create a menu with optgroup labels?

2009-04-27 Thread Frederick Cheung
On Apr 27, 2:28 pm, Jim Burgess wrote: > Thanks for that. > I have now changed the code thus: > > <%= select_tag "applicant[member_1]", > grouped_options_for_select(@grouped_options) %> > > and now I can pick up :member_1 in the params. > Hooray. > > One last thing though, when I submit the for

[Rails] Rails on amazon EC2

2009-04-27 Thread Joshua Partogi
Dear all, Is there anyone that deploys their Rails apps on amazon EC2? I read from AWS website that they have Rails on EC2. Can anyone that use Amazon services share their experience with Rails on EC2? Thank you very much -- If you can't believe in God the chances are your God is too small.

[Rails] Re: Submit form through GET requets

2009-04-27 Thread Cisco Ri
7stud -- wrote: > 7stud -- wrote: >> 7stud -- wrote: >>> >>> Link.create("url" => params[:url]) >>> >>> (that assumes the links table has only one field: url) >>> >>> Apparently when you assign a Link object to the variable @link, rails >>> will create a record in the database corresponding to

[Rails] Re: How do I properly create a menu with optgroup labels?

2009-04-27 Thread Jim Burgess
Thanks for that. I have now changed the code thus: <%= select_tag "applicant[member_1]", grouped_options_for_select(@grouped_options) %> and now I can pick up :member_1 in the params. Hooray. One last thing though, when I submit the form the select menu always springs back to its initial valu

[Rails] Re: What is the sequential steps of installing RoR?

2009-04-27 Thread Sazima
Sheru, Forget about Win, go for Linux over a virtual machine, for example Ubuntu running on Sun xVM VirtualBox. It's way easier, faster, better! Cheers, Sazima On Apr 26, 3:06 pm, sheru wrote: > Hi, > I am Sheru & am completely new for this web framework. I am really > really enthusiastic to k

[Rails] Re: Engines VS rails3

2009-04-27 Thread James Adam
On Apr 27, 5:16 am, "rails.n...@gmail.com" wrote: > What is planned for Rails3 that is preferable over Engines?  Would not > moving to Engines now make it easier to adapt to Rails3 anyway? I think the idea is that Rails 3 will be more modular and have more stable APIs for plugging in engine-like

[Rails] Re: Travel Salesman Problem

2009-04-27 Thread Robert Anderson
Start here: http://en.wikipedia.org/wiki/A*_search_algorithm Regards, -- Robert Anderson Nogueira de Oliveira _ Tribunal de Justiça do Estado de Sergipe Graduando em Sistemas de Informação - UNIT MSN: ranophoe...@hotmail.com "Ausência de evidência não é evidência de ausê

[Rails] Travel Salesman Problem

2009-04-27 Thread Arthur Chan
Hi Guys, I am going to solve the Travel Salesman problem: http://en.wikipedia.org/wiki/Travelling_salesman_problem I wanna find out the shortest path to visit all cities in my site. But... I don't know even where to start for it... (I am able to find out any distance between two cities.) Any cl

[Rails] Re: How do I properly create a menu with optgroup labels?

2009-04-27 Thread Frederick Cheung
On Apr 27, 12:17 pm, Jim Burgess wrote: > Hi Fred, > Well that worked :-) > I changed > <%= f.select :member_1 > into > <%= select_tag :member_1 > and got 100% the desired result. > > Only problem is, is that I am using > <% form_for :applicant, :url=> {:action => "index"} do |f| %> > to create

[Rails] Modern Form Tutorials?

2009-04-27 Thread DVG
Does anyone have a link to a good, modern, tutorial on using forms other than the form_for helper? Basically, I'm looking for a good How To on setting up a Ajax form that sits at the bottom of a list members of a group for adding new users to that group. --~--~-~--~~~--

[Rails] routing: Unescape urls

2009-04-27 Thread Eduard Bondarenko
Hello All, How to make rails unescape incoming urls? I want to use russian chars in routes, like: map.city URI.escape("/Карта--:title--:id"), :controller => "cities", :action => "show" It seems to works (page loads) but all links on page looks like this: http://localhost/%25D0%259A%25D0%25B0%25D

[Rails] Re: How do I properly create a menu with optgroup labels?

2009-04-27 Thread Jim Burgess
Hi Fred, Well that worked :-) I changed <%= f.select :member_1 into <%= select_tag :member_1 and got 100% the desired result. Only problem is, is that I am using <% form_for :applicant, :url=> {:action => "index"} do |f| %> to create my form and removing the reference to the applicant object ("f

[Rails] Re: Using same user credentials across multiple connected apps

2009-04-27 Thread Frederick Cheung
On Apr 27, 10:03 am, sahil wrote: > On Apr 27, 12:37 pm, Frederick Cheung > wrote: > > > Check that the cookie that contains the session is actually being set > > under the right domain (and in development you'll need to fakeup some > > domains eg app1.mydomain.local, app2.mydomain.local). > >

[Rails] ActiveRecord::Errors best practices?

2009-04-27 Thread Joachim Glauche
I'm currently reviewing some old code from Rails 1.x times and found this: ActiveRecord::Errors.default_error_messages = { :inclusion => "inclusion|", :exclusion => "exclusion|", :invalid => "invalid|", :confirmation => "confirmation|", :accepted => "accepted|", :empty =

[Rails] [Rake] Parse XML File, recursive function

2009-04-27 Thread Mickaël Allain
Hi everybody, I'm taking time to post message here because, i have a problem which making me crazy. I'm trying to design a Rake Task which parse XML file and create some drill down on products categories. To begin my explanation, some file and function. First, my XML file > > Voitures >

[Rails] routes, controllers, and intentions

2009-04-27 Thread soldier.coder
I have the following tables: courses, students, and rosters. The rosters table references the courses and students tables. With default routes in place, to list the students in a course I would use: http://localhost:3000/rosters/list but this lists the rosters for all courses. if I use http://

[Rails] How to integration test forms with multiple models

2009-04-27 Thread Jarl Friis
Hi. I try to create an integration test for a form that updates two models (order and floorplan), Creating a functional test for this situation works fine, however I cannot build an equivalent integration test. My master model (order) contains has_many :floorplans accepts_nested_attributes_for

[Rails] routing: Unescape urls

2009-04-27 Thread edbond
Hello All, How to make rails unescape incoming urls? I want to use russian chars in routes, like: map.city URI.escape("/Карта--:title--:id"), :controller => "cities", :action => "show" It seems to works (page loads) but all links on page looks like this: http://localhost/%25D0%259A%25D0%25B0%25D

  1   2   >