[Rails] Re: should the "schema migrations" table have more than one row???

2008-12-14 Thread Greg Hauptmann
I'm guessing that it needs to keep the whole list of migration versions given there's been a change in the way migration version naming are created. So in this case Rails would check to see for each migration, whether there is already an entry in the "schema_migrations" table, and if there is it w

[Rails] Re: RoR + AJAX + Safari = 500 Internal Server Error

2008-12-14 Thread Emanuele Tozzato
Hi, can you post your snippet? thx On Thu, Apr 17, 2008 at 10:42 AM, Arulchandran wrote: > I tried a workaround by changing the method as get for AjaxRequest and > it works for now. > But, still would like to find the root cause of this failure.. --~--~-~--~~~---~-

[Rails] doubts in running a sample web application

2008-12-14 Thread Angappan Ayyavoo
Hai Iam newbie. Iam using ruby on rails, I have some doubts in it. The steps i followed is Using ruby 1.8.6 rails 2.2.2 http://www.ibm.com/developerworks/linux/library/l-rubyrails/ 1) created the rails project name 2)created the table name contacts in the addressbook database name in Mys

[Rails] should the "schema migrations" table have more than one row???

2008-12-14 Thread Greg Hauptmann
Hi, Should the "schema migrations" table have more than one row??? If yes how do you know what the current version is supposed to be? I noted mine looks like the following. Is this a problem? mysql> select * from schema_migrations; ++ | version| ++ | 1

[Rails] how to create a new page using link_to and how to do searching in the page created ?

2008-12-14 Thread srikanth
hi, I have implimented a application for searching the streams from streams table. Presently if i invoke the index page i am seeing the listing of all streams and search box on the same page and after searching, the result is displaying on the same page with all the streams presently available

[Rails] Rubyists Wanted!

2008-12-14 Thread Shamael Keng
BTA IT is pleased to invite applications for this Ruby Developer role with a growing Software Development company. My client is looking to further expand their number of Ruby developers to accommodate its increased amount of project work. My client is looking for a skilled Ruby guru to join this

[Rails] Saving a "final" version of a record.

2008-12-14 Thread Michael Kahle
I'll start by apologizing for the title. I can't think what to call this. I have some Claims that need to be entered, but when they are "closed" it saves the data from other related tables into the Claim (this could get messy), so that if the Customer, Registration, or Dealer information is chan

[Rails] Re: why is wrong with this code - the model "save!" method does not seem to give a correct response back?

2008-12-14 Thread Greg Hauptmann
excellent thanks - not sure how long I would have looked for this one I've tried to summarise this on my blog for furture reference at http://blog.gregnet.org/?p=17 (i.e. on http://blog.gregnet.org) On Mon, Dec 15, 2008 at 7:59 AM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On 1

[Rails] Application failing on undefined method `install_gem_spec_st

2008-12-14 Thread Caps Lock
Hi there, I have rails 2.0.2 installed on my development server and that is where I created this app. I froze the app to 2.0.2 knowing that my host server uses 2.2.2 and that version breaks my application. But when I upload my app to its test bed on the host server I get this error: # ruby dis

[Rails] Re: Initializing list with account creation

2008-12-14 Thread nek4life
On Dec 14, 3:06 pm, Jeremy Weiskotten wrote: > nek4lifewrote: > > I have a model for users and a model for lists and a model for the > > items. > > > I have a one-to-one relationship with the user and the list so only > > one list may be created. > > > I'm having problems when I try to create the

[Rails] link_to problem

2008-12-14 Thread mrbless
Hi guys I face a strange problem. I have written link_to like this <%= link_to "TestGroup", :controller=>'group', :action=>'group_description', :id=>"Web 2.0" %> then i raise params in controller and found that params[:id] is "Web 2" and .0 is lost. What to do for this strange problem. --~--~---

[Rails] Re: many to many and delete question

2008-12-14 Thread Sijo Kg
But the above wont delete the bar record But delete only the association. -- 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

[Rails] Re: search function implimentaion with the tag name as the search box entry

2008-12-14 Thread sreekanth . G
hi , i have implemented search function which list out the streams when i enter a string in the search text box.And here i am not using any search button once i enter the string in the text box it will give the results. Now i want to do the search function by selecting the params from the dropdo

[Rails] Re: How to draw a large chart?

2008-12-14 Thread Khiet Bui
Khiet Bui wrote: > Thanks, man! I will try it. > > If it is okie, i will feedback :) But, how to draw a horizontal bar chart on gnuplot? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

[Rails] Ajax link in select_tag options - problem

2008-12-14 Thread Kala Kala
Hi all, I am a newbie with RoR and am currently stuck with this problem: I have an "ADD CATEGORY" option in the drop down menu for selection, ADD CATEGORY is followed by categories I already added, now when I select "ADD CATEGORY" option I need a DIV containing the form for adding the category b

[Rails] link_to and routing question

2008-12-14 Thread Allen Walker
I have the following link_to: <%= link_to("Remove", {:action => "remove_role_from_account", :role_id => role, :account_id => @account}) %> It generates: http://myserver.com/roles/remove_role_from_account?account_id=1&role_id=5 But this doesn't match the right default route: {:action=>"wsdl"} /

[Rails] Re: Need Help in converting php encryption decryption code to ruby on rails

2008-12-14 Thread mrbless
I will try it and let you know. Thanks for support. On Dec 13, 8:52 am, Andrius Chamentauskas wrote: > Even though i think you should use some known encryption algorythm, > here's translated source (not tested): > > require 'digest/md5' > require 'base64' > > class String >   def ^(value) >    

[Rails] Re: ActionMailer, unit testing and multipart mails

2008-12-14 Thread Trejkaz
Okay, solution found. Requires a combination of two tricks: 1. content_type has to be set after the parts, as you get the error above otherwise. Maybe a bug in TMail, who knows. At least there is a workaround. 2. Boundary strings need mangling. I created myself a convenience method which wil

[Rails] Re: Problem with Acts As Versioned and Save v. Save Without Revision

2008-12-14 Thread Ben Wilson
Sorry for the delay answering. There is a xxx_versions table. Crud. I think I see the problem. This is a legacy db, which has a table named 'bases,' which is a naughty table name. The singular is 'basis,' which I can't inflect because it's a (kinda) reserved name. So, I guess I can magically ren

[Rails] Re: ActionMailer, unit testing and multipart mails

2008-12-14 Thread Trejkaz
On Dec 12, 12:27 pm, Phlip wrote: > if you commented out this line (and any other line that squawks)... > > >     @expected.parts << body_part      # <=== ERROR HERE > > and printed out the mail's parts before asserting them... > > >     mail = Notifier.create_notification() > >     p mail.parts

[Rails] Re: How to draw a large chart?

2008-12-14 Thread Khiet Bui
Thanks, man! I will try it. If it is okie, i will feedback :) -- 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

[Rails] many to many and delete question

2008-12-14 Thread Allen Walker
I have a "has_and_belongs_to_many" relationship between two tables, meaning I have a join table that contains the two ids of each table. For simplicity let's call them "foo" and "bar". I want to delete a bar from a foo but not actually delete the bar itself. foo = Foo.find(1) bar = Bar.find(1)

[Rails] Re: Passing local to template to partial

2008-12-14 Thread Joshua Abbott
You can pass the variable to the action with an instance variable, and from there you can pass the instance variable to the partial, I would think. def whatever @locals => { :universe => 'abc' } render :action => 'new' end Hope that helps. -- Josh http://iammrjoshua.com Jeremy Weiskotte

[Rails] Re: Params error with: complex form+multiple models

2008-12-14 Thread David Sousa
Hi Fred, thanks for answered. So, I have this code generated: item quantity Price remover item quantity Price remover item quantity Price remover item quantity Price remover Or you can see the code here: http://pastie.org/339225 The question is: Should this input() have a

[Rails] require file in rails

2008-12-14 Thread Kaushik katari
Hi, I have a file called dbcon.rb that I put in the config directory. I want to call it from rake, and I was using require 'config/dbcon.rb' This was allowing me to access the classes in this file. Somehow, the require command cannot find this file anymore. Is there a path convention in rails? H

[Rails] Re: I want to create text box but in run time

2008-12-14 Thread Joshua Abbott
There are two problems with that. One, all that's going to do is output the text "text_field" not call the method. Second, text_field requires two arguments object_name and method. So anyway, use the send method to call the text_field method in the view and pass in whatever args you need. #

[Rails] ActiveRecord private method called

2008-12-14 Thread Andrius Chamentauskas
Ok so i just upgraded to rails 2.2.2 and now i'm getting error "Attempt to call private method". I found out that this is because my planet model has attribute named y, which seems is a private attribute in ActiveRecord::Base. I guess rails didn't check if it overwrites private methods before and

[Rails] Re: mysql problem

2008-12-14 Thread Dejan Dimic
and the error is? On Dec 14, 10:09 pm, "titomafia...@gmail.com" wrote: > i have a problem on rails (error message Mysql::Error in > FokashController#index --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rai

[Rails] Re: why is wrong with this code - the model "save!" method does not seem to give a correct response back?

2008-12-14 Thread Frederick Cheung
On 14 Dec 2008, at 21:50, Greg Hauptmann wrote: > PS. Just adding another followup question if I may: > > Q1 - For the future should there been a way for me to have worked > this out myself? i.e. without knowing the internals of Rails, but > by using log information, trying things in conso

[Rails] Re: why is wrong with this code - the model "save!" method does not seem to give a correct response back?

2008-12-14 Thread Greg Hauptmann
PS. Just adding another followup question if I may: Q1 - For the future should there been a way for me to have worked this out myself? i.e. without knowing the internals of Rails, but by using log information, trying things in console etc Q2 - Is there a list of "reserved names" available some

[Rails] I want to create text box but in run time

2008-12-14 Thread mahmoud_cs
I want to create text box but in run time when I write in the controller for @a="input type ='text' " and in the view <%...@a%> it display text box in the page when it run but when I write in the controller for @a="<%=text_field%>" and in the view <%...@a%> it doesn't display text box in the p

[Rails] Re: why is wrong with this code - the model "save!" method does not seem to give a correct response back?

2008-12-14 Thread Greg Hauptmann
wow - thanks heaps For the future should there been a way for me to have worked this out myself? i.e. without knowing the internals of Rails, but by using log information, trying things in console etc Tks On Sun, Dec 14, 2008 at 11:37 PM, Frederick Cheung < frederick.che...@gmail.com> wrote: >

[Rails] mysql problem

2008-12-14 Thread titomafia...@gmail.com
i have a problem on rails (error message Mysql::Error in FokashController#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-talk@googl

[Rails] Re: 12_hour_time plugin broken in 2.2

2008-12-14 Thread mla
On Nov 24, 1:47 pm, jko170 wrote: > This is a widely used plugin I'm guessing and its broken in rails 2.2. > Could someone please take a look at it? There's a version for 2.2 now: http://code.google.com/p/rails-twelve-hour-time-plugin/ --~--~-~--~~~---~--~~ You r

[Rails] finddef - find methods in textmate

2008-12-14 Thread jzimmek
i you have an java/eclipse background like me and missing a "show declaration of method" in textmate, then you should checkout finddef. finddef is a textmate command to quickly find method definitions over multiple source files (including project, rubygems or usersupplied path). http://github.co

[Rails] Re: Capture session end of life routine? def session_has_ended?

2008-12-14 Thread Jeremy Weiskotten
Peter Alvin wrote: > Does RoR define a routine that runs _guaranteed_ when a session ends to > write out session info to database, etc.? > > Pete Not really, because sessions don't just end on their own. You can handle the explicit logout case yourself pretty easily. If you want sessions to ex

[Rails] Re: [announce] wordfractal.com and [question] OpenId or FB Connect?

2008-12-14 Thread Jeremy Weiskotten
shogusumi wrote: > Just a quick shout out to the rails community about my new Pick Your > Own Destiny (or write a new one!) site I put together in rails : > http://www.wordfractal.com/. I've recently tried to streamline it a > bit to make it easier to use... > > It's a pretty straightforward rail

[Rails] Re: Initializing list with account creation

2008-12-14 Thread Jeremy Weiskotten
nek4life wrote: > I have a model for users and a model for lists and a model for the > items. > > I have a one-to-one relationship with the user and the list so only > one list may be created. > > I'm having problems when I try to create the list at the same time I > create the user so they are

[Rails] Initializing list with account creation

2008-12-14 Thread nek4life
I have a model for users and a model for lists and a model for the items. I have a one-to-one relationship with the user and the list so only one list may be created. I'm having problems when I try to create the list at the same time I create the user so they are related by the foreign key on th

[Rails] Re: How to use rake command in Rails application

2008-12-14 Thread Jeremy Weiskotten
Hema Gonaboina wrote: > Hi, > > I want to clear my logs files when they are exceeding certain limit > of > memory >The size of the files can be determined by using the File.size() and > I > can clear the log files using the rake log:clear command >But this has to be done through my

[Rails] Re: Consts for symbols or too anal?

2008-12-14 Thread Jeremy Weiskotten
Jeff B. wrote: > Soliciting some opinions here. > > I keep having this urge to create constants for some of my symbol > keys, so the Ruby interpreter catches my typos. I'm wondering how > other developers handle this / what Rails best practices are. > > The urge is strong for keys that are share

[Rails] Re: need to initialize contant arrays , where to do it...

2008-12-14 Thread Jeremy Weiskotten
Kad Kerforn wrote: > I need to load names, from the table 'domains' into an array > (frequently used in my app..) > ALL_DOMAINS = Domain.find(:all).map { |d| d.name }.compact > > I tried to write it in an initialize or in my application.rb BUT > > problem : when I run a rake db:migrate initial

[Rails] Re: Database cleaning

2008-12-14 Thread Jeremy Weiskotten
Richard Schneeman wrote: > Although i'm using validations in my models, i've managed to get a few > duplicate entries on my site. I've got roughly 300,000 entries, and my > administration only allows long running rake tasks of up to 5 hours. I > need to remove all entries that have the same :word

[Rails] Re: Passing local to template to partial

2008-12-14 Thread Jeremy Weiskotten
Jeffrey L. Taylor wrote: > Quoting Michael Libby : >> Sample of the code that does not work as expected would help us help you. >> >> Documentation on templates: >> http://api.rubyonrails.org/classes/ActionView/Base.html >> Documentation on partials: >> http://api.rubyonrails.com/classes/ActionVi

[Rails] JOBS: Looking for RoR developers to work on enterprise website in Gibraltar

2008-12-14 Thread Swordfish
Hi We have just completed the first phase of replacing our client's betting and gaming website with a new version written in Ruby on Rails. You can see this at http://casino.victorchandler.com/vccasino. We are using Ruby 1.8.6, Rails 2.0.2, Apache, Mongrel, HAProxy, Memcache and MySQL. The web

[Rails] Re: How to build index from model

2008-12-14 Thread Jeremy Weiskotten
astropanic wrote: > Hi, > > I have a application where I have a book model. > I have a book controller, it has an action named "index_titles" > > What should I write in the action of this controller to get a list > with the distinct first letters for each book model in the view ? > > For exampl

[Rails] Re: Passing local to template to partial

2008-12-14 Thread Jeffrey L. Taylor
Quoting Michael Libby : > > On Sat, Dec 13, 2008 at 10:40 PM, Jeffrey L. Taylor > wrote: > > > > I want to pass an array to a template as a local variable. The template > > passes the same local variable to a partial as a local variable. This isn't > > working as I expect and something in the

[Rails] Database cleaning

2008-12-14 Thread Richard Schneeman
Although i'm using validations in my models, i've managed to get a few duplicate entries on my site. I've got roughly 300,000 entries, and my administration only allows long running rake tasks of up to 5 hours. I need to remove all entries that have the same :word and :language. Is there an easy

[Rails] jQuery post function

2008-12-14 Thread DAZ
If you use jQuery to post data, what is the accepted best practice for passing parameters - by putting a query string in the url, or passing them through the data argument of the function? e.g. $.post(/tasks/3?completed=true;,{ _method: "PUT" },null, "script") OR $.post(/tasks/3;,{ _method

[Rails] Re: Updates using urls and query strings

2008-12-14 Thread DAZ
Cheers Fred, that worked great! DAZ On Dec 13, 11:12 pm, Frederick Cheung wrote: > On Dec 13, 7:32 pm, DAZ wrote:> Thanks for the reply > Frederick, I just have two questions: > > > 1) How exactly do I coerce it into a boolean value - is there a best- > > practice way of doing this? > > doesn

[Rails] ActionController::TestRequest bug?

2008-12-14 Thread pk16
Hi, while starting to setup functional tests for my application I received the following error: NoMethodError: undefined method `server_name' for #http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---

[Rails] How to build index from model

2008-12-14 Thread astropanic
Hi, I have a application where I have a book model. I have a book controller, it has an action named "index_titles" What should I write in the action of this controller to get a list with the distinct first letters for each book model in the view ? For example when I have five books: "Amazing

[Rails] Re: custom REST action - template question

2008-12-14 Thread Pavel Krusek
Hi, i thought the template for concrete action 'graduations', no template for layout. Solution: def graduations @schools = School.graduation(true) render :action => "index" end I forgot direction 'render' ;) Thanks, Pavel Zdar :) 2008/12/14 Petr Bobek : > > Pavel Krusek wrote: >> H

[Rails] Re: thin server processes slowly growing in RAM size

2008-12-14 Thread Scott Kulik
Bobnation wrote: > I would see if there are ways for you to implement caching ... but it > also seems like there is maybe a memory leak within your code causing > some problems. I'm not expert, but those are my thoughts. > > On Dec 9, 9:43�am, Scott Kulik thanks for the replies. yea, i think t

[Rails] Re: custom REST action - template question

2008-12-14 Thread Petr Bobek
Pavel Krusek wrote: > Hallo phorum, > > i have custom rest action. > > routes.rb: > map.resources :schools, :collection => { :graduations => :get } > > SchoolsController: > def graduations > @schools = School.graduation(true) > end > > link somewhere in navigation: > <%= link_to 'Schools wit

[Rails] widgets and columns like on the Google home page?

2008-12-14 Thread Stedwick
Does anybody know how to make widgets that you can drag and drop between columns like on the Google homepage? Tutorials, JavaScript libraries, and especially rails plug-ins would be most helpful. Thanks! --~--~-~--~~~---~--~~ You received this message because you ar

[Rails] Re: how to import a dump .sql file in a rake task

2008-12-14 Thread Kaushik katari
I had a similar problem, and started out declaring the username and password in every line of the rake tasks. Did not like that, since I had many rake tasks, and changing a database connection meant changing every line in the rake code. A better way is as follows (I read this from some google post

[Rails] custom REST action - template question

2008-12-14 Thread Pavel Krusek
Hallo phorum, i have custom rest action. routes.rb: map.resources :schools, :collection => { :graduations => :get } SchoolsController: def graduations @schools = School.graduation(true) end link somewhere in navigation: <%= link_to 'Schools with graduation', graduations_schools_path %> All

[Rails] Re: why is wrong with this code - the model "save!" method does not seem to give a correct response back?

2008-12-14 Thread Frederick Cheung
On 14 Dec 2008, at 10:54, Ryan Bigg wrote: > Transaction is a reserved class in Rails. That's not quite the whole story. The issue that if you have belongs_to transaction in your model that creates a transaction method for reading the association. This overwrites an internal method called t

[Rails] Re: Passing local to template to partial

2008-12-14 Thread Michael Libby
On Sat, Dec 13, 2008 at 10:40 PM, Jeffrey L. Taylor wrote: > > I want to pass an array to a template as a local variable. The template > passes the same local variable to a partial as a local variable. This isn't > working as I expect and something in the back of my mind is says that I read > s

[Rails] Re: Virtual hosts not using their own databases

2008-12-14 Thread Redd Vinylene
John Yerhot wrote: > > So if you start only site2's mongrel cluster it actually uses the data > site3_production, though it's database.yml specifies site2_production? > > also, I think you forgot the 't.' in your rake tasks > > task :install_site3 => :environment do |t| > t.load_database >

[Rails] Re: why is wrong with this code - the model "save!" method does not seem to give a correct response back?

2008-12-14 Thread Ryan Bigg
Transaction is a reserved class in Rails. - Ryan Bigg Freelancer http://frozenplague.net On 14/12/2008, at 9:13 PM, Greg Hauptmann wrote: > still stuck here > > When I create a new "allocation" model object, I check it is valid > OK, but when I "save!" it I just get a "nil"? What wou

[Rails] Re: why is wrong with this code - the model "save!" method does not seem to give a correct response back?

2008-12-14 Thread Greg Hauptmann
still stuck here When I create a new "allocation" model object, I check it is valid OK, but when I "save!" it I just get a "nil"? What would this imply. There's no error as such. It is true to say that I populated the non-null columns with relationship with ID's of just "1" (i.e. didn't ensure

[Rails] Re: Problem with parameters

2008-12-14 Thread joripel
With case params[:tabla] the variables are the same. I can't use params[:tabla] in elijovista controller :( --~--~-~--~~~---~--~~ 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] [announce] wordfractal.com and [question] OpenId or FB Connect?

2008-12-14 Thread shogusumi
Just a quick shout out to the rails community about my new Pick Your Own Destiny (or write a new one!) site I put together in rails : http://www.wordfractal.com/. I've recently tried to streamline it a bit to make it easier to use... It's a pretty straightforward rails app - the more interesting

[Rails] Re: Avoiding Clutter in views

2008-12-14 Thread Alan Brown
What are the performance impacts of these various techniques? Has anyone managed or reduced complexity using layouts in any particularly clever ways? al On Sun, Dec 14, 2008 at 12:14 AM, Andrew Bloom wrote: > > Don't forget about helpers. Helpers that take blocks are especially > useful, it's

[Rails] Re: Avoiding Clutter in views

2008-12-14 Thread Andrew Bloom
Don't forget about helpers. Helpers that take blocks are especially useful, it's a really easy way to conditionally display some content without cluttering the view. # Helper def is_authorized(action, resource, &block) yield if current_user.permission_check(action, resource) end # View <% is_a