[Rails] Iterating through each record of a model and copy that to an

2008-09-25 Thread Sijo Kg
Hi I have to copy all the service desk cis to incident cis as part of converting sd_ticket to incident..So in the Incident model I did sd_ticket=ServiceDeskTicket.find(sd_id) Then a new incident @incident is created here sd_cis=sd_ticket.get_sd_cis #here I got all the service desk cis (Relati

[Rails] Re: has_many / belongs_to associations

2008-09-25 Thread Pokkai Dokkai
Jon wrote: > def create > @review=Review.new(params[:review]) > @[EMAIL PROTECTED] thats correct syntax (if @album is a object of Album model) > > i'm not sure that @[EMAIL PROTECTED] is the correct syntax, but even > at the command line when I instantiate an object of type Review an

[Rails] rails -1.2.3 to 2.1.1 ? how ?

2008-09-25 Thread Pokkai Dokkai
now i am working in a rails project version 1.2.3 but i like to work in rails 2.1.1 i thing by freexe the 1.2.3 gemm into vendor will solve the problem but i have 35 plugin in my project(which is version 1.2.3) so i worried about freezeing old gem into vendeor any help appreciated? thanks -- Po

[Rails] Re: :mem_cache_store and memcache-client

2008-09-25 Thread Sathish Thandavan
Hi, Above code is working fine, you assign the memcached server where you run memcache server memcache_servers = "localhost:11211" above line you replace localhost as IP(i.e,)where memcache server running ex:memcache_servers = "168.162.10.26:11211" -- like this and start memcache server

[Rails] Can anyone help? regarding simple_captcha plugin

2008-09-25 Thread sadeesh kumar
simple_captcha does not work in test environment --- Hi, I have been using simple_captcha and it works fine and make myself happy. When I moved my app to test environment, It does not throwing message when the letters in t

[Rails] Re: rails -1.2.3 to 2.1.1 ? how ?

2008-09-25 Thread Pokkai Dokkai
Pokkai Dokkai wrote: > now i am working in a rails project version 1.2.3 > but i like to work in rails 2.1.1 > i thing by freexe the 1.2.3 gemm into vendor will solve the problem > but i have 35 plugin in my project(which is version 1.2.3) > so i worried about freezeing old gem into vendeor > > a

[Rails] has_many / belongs_to associations

2008-09-25 Thread Jon
I have two models, Review and Album. Album has many reviews, and Review belongs to Album as seen below in their respective model files. class Review < ActiveRecord::Base belongs_to :album end class Album < ActiveRecord::Base has_many :reviews end I then added a form to submit r

[Rails] format.xml not rendering associated model properly

2008-09-25 Thread Anthony Ettinger
respond_to do |format| format.html # index.html.erb format.xml { render :xml => @directories } end # The model directory belongs to a software instance. -- Anthony Ettinger 408-656-2473 http://anthony.ettinger.name --~--~-~--~~~---~--~~ You r

[Rails] Re: jquery, format.js and IE

2008-09-25 Thread andres
On Fri, 2008-09-26 at 01:38 +0200, Bryan M. wrote: > I'm trying to use jQuery to write all my js unobtrusively, and running > into a bit of a problem when triggering the format.js block in IE6 (and > possibly IE7). It returns the JSON string no problem, but instead of > parsing it, IE6 asks to dow

[Rails] [ANN] Classy Inheritance Rel. 0.6.2

2008-09-25 Thread Andrew Stone
*About:* http://stonean.com/wiki/classy-inheritance Classy Inheritance simplifies the definition and implementation of one object depending on another object. For example, a User object depending on a Person object. If you do the following: class User < ActiveRecord::Base depends_on :person

[Rails] sortable_column_headers plugin not sorting properly?

2008-09-25 Thread Anthony Ettinger
It appears the default sort direction is always sent to the query, even if a different column is clicked to sort. For example: add_to_sortable_columns('search', :model => Status, :field => 'name', :sort_direction => :desc) that results in: ORDER BY statuses.name DESC,directories.updated_at DE

[Rails] Re: Very Newbie Question - script/generate model

2008-09-25 Thread Chris To
heimdull wrote: > rails newapp > cd newapp > ruby script/generate model Page > > does that give anything? Hi heimdull, Yes, it generates the following, which is what shows in the tutorial: exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/page.r

[Rails] Re: Very Newbie Question - script/generate model

2008-09-25 Thread heimdull
rails newapp cd newapp ruby script/generate model Page does that give anything? --~--~-~--~~~---~--~~ 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@goo

[Rails] moving to Rails 2.x

2008-09-25 Thread lunaclaire
Finally about to make the move from 1.2.6 to 2.? and am curious about strategy... I've looked at a bunch of postings across the web about upgrading, but many of them seem to be written back when 2.0 was only a RC and it seems like this has been a changing picture throughout the year (one of the r

[Rails] Re: attachment_fu and acts_as_list - a land war in Asia

2008-09-25 Thread emarthinsen
Got it! This was a tricky one. I'll post the solution here since I've seen some other posts where people got unsatisfactory results. I'm pleased with how this came out. Here is my ProductImage class, in its entirety. class ProductImage < ActiveRecord::Base belongs_to :product acts_as_list

[Rails] jquery, format.js and IE

2008-09-25 Thread Bryan M.
I'm trying to use jQuery to write all my js unobtrusively, and running into a bit of a problem when triggering the format.js block in IE6 (and possibly IE7). It returns the JSON string no problem, but instead of parsing it, IE6 asks to download the resource as a .js file. So if my url is '/pictur

[Rails] Re: defining polymorphic type condition

2008-09-25 Thread Aryk Grosz
Or better yet, any solutions/patches? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@goog

[Rails] defining polymorphic type condition

2008-09-25 Thread Aryk Grosz
As great as Rails 2.1 is, I for the life of me cannot figure out why polymorphic associations do not support reconfiguring the type column used. For example, I have no way to do a polymorphic association using a lookup hash which maps an integer to a class name. Storing a TINYINT unsigned is waa

[Rails] attachment_fu and acts_as_list - a land war in Asia

2008-09-25 Thread emarthinsen
Hello- I'm trying to get a list of attachment_fu objects (type of ProductImage) to play well with acts_as_list. Essentially, a single Product can have multiple ProductImages arranged in a sorted list (which feeds into a slideshow, ultimately). If it wasn't clear from the title, this isn't going

[Rails] Re: http request inside controller?

2008-09-25 Thread Hubert Łępicki
Hi, Can you access any other sites using http from within your controllers? I see you are using Windows - does firewall allow your mongrels/ webrick to access Internet? If it's timeout issue, you can easily increase timeout with net/http library like: Net::HTTP.start('www.whatever.org.uk') { |h

[Rails] Re: Track number of clicks on a link

2008-09-25 Thread andres
On Thu, 2008-09-25 at 13:52 -0700, Dan Paul wrote: > Thanks for the response, sorry I'm totally new to this any way you can > elaborate or show example? Any help would be greatly appreciated, > thanks in advance > > On Sep 25, 11:53 am, andres <[EMAIL PROTECTED]> wrote: > > On Thu, 2008-09-25 at

[Rails] Very Newbie Question - script/generate model

2008-09-25 Thread Chris To
Hi All, I am working the 20 minute wiki tutorial http://sl33p3r.free.fr/tutorials/rails/wiki/wiki-en.html. Right at the beginning after I get my web server up I try to create the Page model in the command line: script/generate model Page After I hit Enter nothing happens. I've searched online a

[Rails] Re: Settings request.domain for testing purposes

2008-09-25 Thread Hubert Łępicki
Hi, On 25 Wrz, 21:02, Fernando Perez <[EMAIL PROTECTED]> wrote: > My app, relies on request.domain to display some data according to the > domain. > > However during RSpec tests, the request.domain is set to "test.host". Is > there a way I can manually set it for the test environment? Yes, you c

[Rails] Re: Track number of clicks on a link

2008-09-25 Thread Marc Byrd
Note that writing to the db every time something on your site is viewed can really limit your capacity and scale and hasten the day when you'll need to think about multi-master configuration. So unless you're using something like amazon SimpleDB, which scales for you, it might be better to figure

[Rails] Re: Will acts_as_paranoid work with attachment_fu?

2008-09-25 Thread Chris Bloom
I poked around and figured this out myself. I had to add the following to my document model: class Document < ActiveRecord::Base ... acts_as_paranoid #do not destory file (usually called from after_destroy) def destroy_file return end end Chris Bloom wrote: > I'm now wondering i

[Rails] Re: error running "script/console --sandbox" on Edge

2008-09-25 Thread derickatunc
mike, yeah. i'm 2.1.0 and i have it as well. On Sep 23, 2:06 pm, Mike Breen <[EMAIL PROTECTED]> wrote: > Loading development environment in sandbox (Rails 2.2.0) > Any modifications you make will be rolled back on exit > /my_project/vendor/rails/activerecord/lib/active_record/base.rb: > 1760:in

[Rails] Re: Back ground Job

2008-09-25 Thread Robert Walker
> wrong number of arguments (1 for 0). Well, according to this it's trying to tell you that you are sending 1 argument to a method that expects 0. > MailingsWorker#send_mailing({:uid=>"mailings_workers:send_mailing:ab6867ccb04cb1180afeb50c7f8 And MailingsWorker#send_mailing would be that method.

[Rails] Re: Track number of clicks on a link

2008-09-25 Thread Dan Paul
Thanks for the response, sorry I'm totally new to this any way you can elaborate or show example? Any help would be greatly appreciated, thanks in advance On Sep 25, 11:53 am, andres <[EMAIL PROTECTED]> wrote: > On Thu, 2008-09-25 at 11:35 -0700, Dan Paul wrote: > > Hello, > > > So I am trying to

[Rails] Re: multiple in one form

2008-09-25 Thread andres
On Thu, 2008-09-25 at 12:11 -0700, Nathan R wrote: > I am having this same problem, but I need to do this with ajax. > any ideas? I've been racking my brain on this for a few hours now and > am losing it, > > On Sep 22, 6:47 am, jney <[EMAIL PROTECTED]> wrote: > > Hi erol, > > > > Try this :

[Rails] Re: Chaining two named_scope that have a block of code

2008-09-25 Thread Fernando Perez
I solved it by appending the first method to the chain. I have another problem: I want to chain 2 named_scopes that both have a :joins in their definition. The problem is that the :joins of the second named_scope in the chain doesn't get added to the query. IS that normal behavior? -- Posted

[Rails] Re: Writing to innodb reading from myisam

2008-09-25 Thread Maurício Linhares
Hi, Well, i haven't tried it myself, but as far as the "High Performance MySQL" book can say, this is possible and there is nothing preventing you from doing it, you just have to be sure about the risks you will be taking, as even with replication, the slave database using MyISAM could get corrup

[Rails] Re: multiple in one form

2008-09-25 Thread Nathan R
I am having this same problem, but I need to do this with ajax. any ideas? I've been racking my brain on this for a few hours now and am losing it, On Sep 22, 6:47 am, jney <[EMAIL PROTECTED]> wrote: > Hi erol, > > Try this : > > <% form_for(@master_model) do |f| %> >   <%= f.error_messages

[Rails] Settings request.domain for testing purposes

2008-09-25 Thread Fernando Perez
My app, relies on request.domain to display some data according to the domain. However during RSpec tests, the request.domain is set to "test.host". Is there a way I can manually set it for the test environment? Thanks for your tip -- Posted via http://www.ruby-forum.com/. --~--~-~--~-

[Rails] Writing to innodb reading from myisam

2008-09-25 Thread birdwatcher
Hi - We're pondering whether this is possible or whether anyone else has done this. We would like to write records to an innodb database (master) but have the front-end of out app interface a myisam (slave) database. So have our app use two databases. Reason is - we want to allow users to safe

[Rails] Re: Track number of clicks on a link

2008-09-25 Thread andres
On Thu, 2008-09-25 at 11:35 -0700, Dan Paul wrote: > Hello, > > So I am trying to simply track the number of hits a link has received > and display that number on the site so other users can see which links > are more popular. So once the link is clicked on it adds a +1 value to > the hits column

[Rails] Track number of clicks on a link

2008-09-25 Thread Dan Paul
Hello, So I am trying to simply track the number of hits a link has received and display that number on the site so other users can see which links are more popular. So once the link is clicked on it adds a +1 value to the hits column in the database and then redirects the person to the url that

[Rails] Re: How to pass parameters to controller method from view?

2008-09-25 Thread Phillip Koebbe
John Do wrote: > So you can't really use a view call a controller/helper methods with > arguments via link? You can call helpers from views, but not controller methods. Keep in mind that the view is what's going to get rendered to the client. So any reference to a controller method is in the c

[Rails] Re: Inflector >> "progress"

2008-09-25 Thread Andres Rodriguez
Hi Timothy, your code is right. Here's the thing: Inflector.classify is used to see how rails converts to table_name to Model name. So you have to do this: Inflector.classify "progresses" Inflector.pluralize gives you the contrary. If you want more information take a look at this: http://api.r

[Rails] Will acts_as_paranoid work with attachment_fu?

2008-09-25 Thread Chris Bloom
I've got a problem in that users are deleting a paranoid model through the application, including dependents. Some of these dependents are paranoid too, but not the attachments. (I'm using DB file storage.) I need to be able to un-delete these things and I'm now wondering if acts_as_paranoid will

[Rails] Re: Newbie Join-Model Misery

2008-09-25 Thread Ar Chron
Ad Richards wrote: > I have got as far as making it so that a grade field is automatically > created for each new assignment: > > def create > @assignment = Assignment.new(params[:assignment]) > @gradation = @assignment.gradations.build(params[:gradation]) > > But I don't know how to p

[Rails] Re: How to pass parameters to controller method from view?

2008-09-25 Thread John Do
So you can't really use a view call a controller/helper methods with arguments via link? Let's say I have a helper with method def say_hello(string1, string2) puts "#{string1} say hello to #{string2}" end I know in the view, I can do <% say_hello("Bob", "Jill") %> and the console will print o

[Rails] Re: map.routes.rb pls help

2008-09-25 Thread Andres Rodriguez
That should be because you haven't modified the name property of you text field. On Thu, Sep 25, 2008 at 10:39 AM, Lost Warrior < [EMAIL PROTECTED]> wrote: > > hi i am having a search option in my application.after the search url is > going as /search?query=linux. > > I want to achieve it as /sea

[Rails] Re: Fixtures and created_at

2008-09-25 Thread John Barnette
Hi, On Wed, Sep 24, 2008 at 8:21 PM, Jean Nibee <[EMAIL PROTECTED]> wrote: > When I use a fixture yml file to load setup data into my database my > created_at fields are always being set to '-00-00 00:00:00' The fixtures code in 2.0+ should set your timestamped columns to Time.now automatica

[Rails] Re: Agile Web Development with Rails Second vs Third edition

2008-09-25 Thread Fernando Perez
James Burka wrote: > I would recommend 'The Rails Way' by Obie Fernandez I found that much > more helpful than the Agile Web Dev book > > On Sep 18, 5:07�pm, Robert Walker <[EMAIL PROTECTED]> I would certainly not recommend the Rails Way to a beginner. The best IMHO is the Agile Web Dev with Ra

[Rails] Chaining two named_scope that have a block of code

2008-09-25 Thread Fernando Perez
Hi, I have a named_scope that retrieves all the products for the current website based on its domain name: -- named_scope :site, lambda { |website_name| { :joins => :site, :order => 'products.created_at DESC', :conditions => ['sites.domain_name = ?', website_name]}}

[Rails] Re: Updating ultrasphinx index after save?

2008-09-25 Thread Maarten Porters
Thanks Maurício, Ok, I'll also give it a shot :) ... Damn, I've now tried Ferret - Ultrasphinx ... and now Solr :) . Madness. Actually I kind of liked Ultrasphinx. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message beca

[Rails] Re: ActionMailer::Base send via "secure connection"?

2008-09-25 Thread Jesse
http://www.rubyinside.com/how-to-use-gmails-smtp-server-with-rails-394.html This is a good solution. --~--~-~--~~~---~--~~ 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

[Rails] Acts_as_ferret, DRb, 4 monrels and complete site lockups

2008-09-25 Thread Hubert Łępicki
Hi, I am having some serious problems with site that's already live. It is using RoR 1.2, ferret 0.11.6 and most recent acts_as_ferret plugin. Most of the day, site is doing pretty well, is quick and search is reliable. But, at some point, it just "locks" and stops responding, one instance of mo

[Rails] Re: Updating ultrasphinx index after save?

2008-09-25 Thread Maurício Linhares
If you really need index updates to happen when a record is updated, you should use Solr. On Thu, Sep 25, 2008 at 2:01 PM, Maarten Porters <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm trying out Ultrasphinx instead of ferret. Unfortunately it seems not > to be possible to update the index (in an ef

[Rails] Updating ultrasphinx index after save?

2008-09-25 Thread Maarten Porters
Hi, I'm trying out Ultrasphinx instead of ferret. Unfortunately it seems not to be possible to update the index (in an efficient way) after creating or updating a record. I managed to run the update index rake task, but that's not a good option. Here is what I tried: def update @user = Us

[Rails] Re: md5 User Registration Form

2008-09-25 Thread Andi Geheim
If nobody knows that, mayby someone can tell me how update the :password befor saving? Greetings Andi -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

[Rails] Spider Charts and Gruff: THE JOY OF GRAPHING

2008-09-25 Thread Joe Peck
I hope this day finds you well. I need to generate Spider charts (aka radar charts) , and am using Gruff to do so. How can I show lines and axis numbers on a Spider chart? Here's what I'm trying to make: http://img.skitch.com/20080925-m573hhdy4n4x6i92s17knjqjeg.jpg How can I ha

[Rails] find_by_sql suggestions needed

2008-09-25 Thread cnjohnson
I have an application that generates an ever growing list of stock reports. I find myself some method in a controller creating a connection to the database (postgres in this case), executing a custom sql, using the data returned to create one or more graphs with gruff, and sending them off to be d

[Rails] Re: Inflector >> "progress"

2008-09-25 Thread Timothy Johnson
Sure, there are other options out there to describe it. Would this be a consideration that the inflector is broken though? Jeff Cohen wrote: > Any chance you can use "progression" or "step" instead of "progress"? > Might be easier for the inflector to figure things out...? > > Jeff -- Pos

[Rails] Re: Inflector >> "progress"

2008-09-25 Thread Jeff
On Sep 25, 11:02 am, Timothy Johnson <[EMAIL PROTECTED] s.net> wrote: > I have this in my Inflector file: > ActiveSupport::Inflector.inflections do |inflect| >   inflect.irregular 'progress', 'progresses' > end > > but when I run: > > >> "progress".classify > > i get > => Progres > > Obviously thi

[Rails] Inflector >> "progress"

2008-09-25 Thread Timothy Johnson
I have this in my Inflector file: ActiveSupport::Inflector.inflections do |inflect| inflect.irregular 'progress', 'progresses' end but when I run: >> "progress".classify i get => Progres Obviously this is messing up some internals. Progress doesn't really count as "uncountable" Any help is a

[Rails] map.routes.rb pls help

2008-09-25 Thread Lost Warrior
hi i am having a search option in my application.after the search url is going as /search?query=linux. I want to achieve it as /search/linux using routes.rb i am giving it as map.search 'search/*query_text',:controller => "home",:action => "search" but it is coming as search?query=linux -- Po

[Rails] Re: controller issue with plurals

2008-09-25 Thread Bobnation
Have you tried map.resources :main? On Sep 21, 10:50 pm, Grayson Piercee <[EMAIL PROTECTED] s.net> wrote: > Ryan Bigg wrote: > > How are you mapping it in the routes.rb? > >   map.resource :main > -- > Posted viahttp://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You

[Rails] Re: Agile Web Development with Rails Second vs Third edition

2008-09-25 Thread Bobnation
A good idea. The Beta PDF is available straight from PragProg ... you can give that a shot as well. On Sep 20, 6:40 am, "Commander Johnson" <[EMAIL PROTECTED]> wrote: > You can learn rails with v2, but some things like migration file names and > especially dynamic scaffolding will be different. I

[Rails] Re: Help regarding sending email

2008-09-25 Thread sreeprasad sp
Thank you all so much for those suggestions. I have changed the settings of my SMTP. But now I get getaddrinfo: servname not supported for ai_socktype. :/PROGRA~1/BITNAM~1/ruby/lib/ruby/1.8/net/protocol.rb:209:in `initialize' C:/PROGRA~1/BITNAM~1/ruby/lib/ruby/1.8/net/protocol.rb:209:in `new'

[Rails] Re: Modifying existing model with migrations

2008-09-25 Thread Frederick Cheung
On Sep 25, 3:01 pm, "Jon Liu" <[EMAIL PROTECTED]> wrote: > Fred, > Thanks. > > So I ran rake db:migrate VERSION=0.  Then I tried to view my table structure > under the console command line, to which I got an error(as expected since we > roll back to version 0) > > I ran the rake db:migrate again

[Rails] Re: Fat Model Thin Controller

2008-09-25 Thread bingo bob
That's very helpful, many thanks. The mists have cleared! Until the next time. hehe. bb -- 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] Re: Modifying existing model with migrations

2008-09-25 Thread Jon Liu
Fred, Thanks. So I ran rake db:migrate VERSION=0. Then I tried to view my table structure under the console command line, to which I got an error(as expected since we roll back to version 0) I ran the rake db:migrate again and now I have my updated table. Why do you have to rollback a version t

[Rails] Re: Fat Model Thin Controller

2008-09-25 Thread Erol Fornoles
On Sep 25, 8:43 pm, bingo bob <[EMAIL PROTECTED]> wrote: > But two things > > > @adverts = current_user.adverts || [] <-- can you explain the "|| []" part? It assigns the empty array [] to @adverts if current_user.adverts is nil, otherwise it works just like a normal assign. Think of it as a shor

[Rails] Re: Subdomains

2008-09-25 Thread Sav
The only thing I change is that before_filter :detect_request Detecting the browser's user agent works (see below), but detecting subdomains does not. def iphone_request? # Mobile Safari request.env["HTTP_USER_AGENT"] && request.env["HTTP_USER_AGENT"][/ (Mobile\/.+Safari)/] end On S

[Rails] Re: Help regarding sending email

2008-09-25 Thread sreeprasad sp
I tried to change the DOMAIN name . Now I am recieving End Of File reached error. getaddrinfo: no address associated with hostname. lib/smtp_tls.rb:10:in `initialize' lib/smtp_tls.rb:10:in `open' lib/smtp_tls.rb:10:in `do_start' lib/smtp_tls.rb:10:in `do_start' app/controllers/email_controller.r

[Rails] Re: save blob to file?

2008-09-25 Thread blasterpal
The reason no error is thrown has nothing to do with Rails, but Ruby. IO write is the actual method that is being called, correct? See this: http://www.ruby-doc.org/core/classes/IO.html#M002296 According the the Ruby API is returns the number of bytes written. I would suggest you add a check on y

[Rails] Re: Help regarding sending email

2008-09-25 Thread blasterpal
Email Senders in distress, "getaddrinfo: no address associated with hostname. " Likely now ruby/smtp is trying to do a DNS lookup on the domain you provided. So if you made a hostname that actual does not resolve to anything it will get upset. The simplest thing to do is add the new domain to yo

[Rails] Re: save blob to file?

2008-09-25 Thread Vicky Shaw
Frederick Cheung wrote: > On 24 Sep 2008, at 15:52, Vicky Shaw wrote: > >>> to >>> change the mode to 'wb' >> I am using OpenSuse OS. I guess 'b' is needed on Windows OS to save it >> as a binary file. >> Problem: I don't see any such file on my filesystem. >> > more likely that you don't h

[Rails] Re: update each record in order to update Ferret index?

2008-09-25 Thread Maarten Porters
> Hi, could you tell us about the actual configuration of ferret? How's > Ferret > working in development mode without the ferret_server? Is the > ferret_server > up and operational in the production environment? > > -Conrad Hi Conrad, In development mode, I'm just using the local index wit

[Rails] Re: Auto refresh field

2008-09-25 Thread Alexandre Petitjean
that's it! Thanks ! 2008/9/25 joserwan <[EMAIL PROTECTED]> > > Maybe Aptana automatically include links to prototype as it misses. > You have to include in your page header : > > <%= javascript_include_tag :all %> > > or less (don't know wich file is needed for the updater) : > > <%= javascript_

[Rails] Re: Newbie Join-Model Misery

2008-09-25 Thread Frederick Cheung
On 25 Sep 2008, at 13:53, Ad Richards wrote: > > Oh that's a good point, I didn't consider that. > > What do you mean by working around the editing stuff? > Do you mean like including an "if, else" somewhere in the view. > i.e: if a grade already exists for a student and assignment then show > i

[Rails] Re: Auto refresh field

2008-09-25 Thread joserwan
Maybe Aptana automatically include links to prototype as it misses. You have to include in your page header : <%= javascript_include_tag :all %> or less (don't know wich file is needed for the updater) : <%= javascript_include_tag 'prototype' %> Erwan On Sep 25, 4:16 am, "Alexandre Petitjean"

[Rails] Re: Newbie Join-Model Misery

2008-09-25 Thread Ad Richards
Oh that's a good point, I didn't consider that. What do you mean by working around the editing stuff? Do you mean like including an "if, else" somewhere in the view. i.e: if a grade already exists for a student and assignment then show it, otherwise create a new one (with a default value).?? --

[Rails] Re: Fat Model Thin Controller

2008-09-25 Thread bingo bob
OK, But two things > @adverts = current_user.adverts || [] <-- can you explain the "|| []" part? and... I want to check for it being nil, would I do this in the controller (I think I must as the error is generated from that point - i.e. it doesn't get as far as the view if there are no ads

[Rails] Re: update each record in order to update Ferret index?

2008-09-25 Thread Conrad Taylor
On Thu, Sep 25, 2008 at 4:30 AM, Maarten Porters < [EMAIL PROTECTED]> wrote: > > Hi, > > I'm having some problems on a particular acts_as_ferret model. > Rebuilding the index with Model.rebuild_index does not seem to work. No > results are returned after indexing. However, > when I update each rec

[Rails] Calling action on OnClick event of a div

2008-09-25 Thread Jaikishan Jalan
I was wondering how can I call an action of a particular controller when a person clicks on a particular div. Any related pointers? -- Thanks, Jaikishan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails

[Rails] New to Programming

2008-09-25 Thread Chris To
Hi Abel, Ah, so that's how it works? So I am guessing if you have a debit card without a credit card number you can't sign up for paypal? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

[Rails] Re: Fat Model Thin Controller

2008-09-25 Thread Erol Fornoles
On Sep 25, 8:07 pm, bingo bob <[EMAIL PROTECTED]> wrote: > > good point, but wrong for Rails. > > Use your first version. > > > @adverts = current_user.adverts > > OK, but the thing is, this fails if the user doesn't have any adverts? You'll need to test for current_user.adverts first before you

[Rails] Re: How to pass parameters to controller method from view?

2008-09-25 Thread Phillip Koebbe
John Do wrote: > Controllers/files_controller.rb > class FilesController < ApplicationController > def export_database(obj) > obj.save_to_file > end > end > > > > Views/files/show.html.erb > <% [RmEnv, RmProc].each do |db_obj| %> > <%= button_to "export database #{db_obj}", :action => exp

[Rails] Re: Fat Model Thin Controller

2008-09-25 Thread bingo bob
> good point, but wrong for Rails. > Use your first version. > > @adverts = current_user.adverts > OK, but the thing is, this fails if the user doesn't have any adverts? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message

[Rails] Re: update each record in order to update Ferret index?

2008-09-25 Thread Thorsten Müller
no real help for your actual problem. But we moved an existing project from ferret to sphinx, for exactly the reasons you mention. Everything working fine in dev, but fails in prod. If you google around a bit, you'll find that this seems a common problem with ferret. I would recommend moving to

[Rails] Join different querys in the same object

2008-09-25 Thread Daniel A.
Hi, I'm new in Ruby on Rails and I don't know how can I achive something like this: @switchs = Switch.find(:all) for switch in @switchs if current_user.shifts.count(:all,:conditions=>["date = ? and shift = ?",switch.destiny_date, switch.destiny_turn]) !=0 @valid = switch

[Rails] Problem reading excel sheets

2008-09-25 Thread abhishek singhal
> Hi, > > I am new to ruby on rails.I am having problem reading excel files. I > tried using gem 'parseexcel' but still the error is coming. > Could you please help me with the code and how to use this gem? Is > there any better way to read excel sheets. > > Snippet of Code: > > require 'rubygems

[Rails] update each record in order to update Ferret index?

2008-09-25 Thread Maarten Porters
Hi, I'm having some problems on a particular acts_as_ferret model. Rebuilding the index with Model.rebuild_index does not seem to work. No results are returned after indexing. However, when I update each record manually, the index seems to be correct. This is my model: class Article < ActiveRec

[Rails] Re: Newbie Join-Model Misery

2008-09-25 Thread Frederick Cheung
On 25 Sep 2008, at 11:17, Ad Richards wrote: > > Thanks fred, > > The problem with creating gradations separately when students complete > assignments, is that I am then left with no fields in my view in which > to enter grades. My plan was to have it so that when an assignment was > created, a

[Rails] Re: MYSQL GEM not found at rubyforge

2008-09-25 Thread Maarten Porters
Hi Peter, sounds like you're right. The problem was solved after updating rubygems. 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.

[Rails] Problem with ar_mailer

2008-09-25 Thread Roberto Druetto
Hi guys, I'm running a strange problem sending emails. Basicly I'm getting this exception: ArgumentError (wrong number of arguments (1 for 0)): /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/ base.rb:642:in `initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_r

[Rails] Re: GRANT: help me!

2008-09-25 Thread Al Shox
> You might want to try Dr. Nic's Magic Multi-Connections to make the > job easier. Nice name anyway ;) > http://magicmodels.rubyforge.org/magic_multi_connections/ I'll going to see.. Thanks! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You

[Rails] Re: Using variables in dynamic finds

2008-09-25 Thread Erol Fornoles
On Sep 25, 6:01 pm, Thorsten Müller <[EMAIL PROTECTED]> wrote: > Depends on some details. the results: > > Date.today: "2008-09-25" > Time.now: "2008-09-25 11:56:21" > > So Date.today would get you all records of today, including those from > the morning to now. > Time.now includes the time, ignor

[Rails] Re: GRANT: help me!

2008-09-25 Thread Erol Fornoles
On Sep 25, 6:08 pm, Al Shox <[EMAIL PROTECTED]> wrote: > Three db accounts, and they are fixed. > -- > Posted viahttp://www.ruby-forum.com/. You might want to try Dr. Nic's Magic Multi-Connections to make the job easier. http://magicmodels.rubyforge.org/magic_multi_connections/ --~--~-~-

[Rails] Re: Newbie Join-Model Misery

2008-09-25 Thread Ad Richards
Thanks fred, The problem with creating gradations separately when students complete assignments, is that I am then left with no fields in my view in which to enter grades. My plan was to have it so that when an assignment was created, a corresponding grade field would be created for each stude

[Rails] Re: How to find records, placing conditions on joined table?

2008-09-25 Thread Carmine Moleti
Hi there Erol! Thanks so much for your help! > User.find(:all, :joins => :roles, :conditions => ["roles.name IN (?)", > ["admin", "editor"]) That's wy better! Thank you -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this messag

[Rails] Back ground Job

2008-09-25 Thread kurian
i am using starling and workling for sending mail in background This is giving me an error Calling MailingsWorker#send_mailing({:uid=>"mailings_workers:send_mailing:ab6867ccb04cb1180afeb50c7f8f5ad4", :email=>"[EMAIL PROTECTED]"}) FAILED to process queue mailings_workers__send_mailing. # could

[Rails] Re: Fat Model Thin Controller

2008-09-25 Thread Thorsten Müller
> I have this working with the following code, as I say in the adverts > controllers index action. > > @adverts = current_user.adverts > > Now then, I figure that in the correct place to do the finding of a > users adverts is in the adverts model. This should give me the ability > to do the find a

[Rails] Re: GRANT: help me!

2008-09-25 Thread Al Shox
Erol Fornoles wrote: > On Sep 25, 8:03�am, Al Shox <[EMAIL PROTECTED]> wrote: >> > � :username => "admin", >> solutions.. and I really don't want!! >> -- >> Posted viahttp://www.ruby-forum.com/. > > Not necessarily. How many kinds of db user accounts do you have? Are > they fixed, or do you have

[Rails] Re: Using variables in dynamic finds

2008-09-25 Thread Thorsten Müller
> I think Date.today might be more logically correct than using > Time.now, though. Depends on some details. the results: Date.today: "2008-09-25" Time.now: "2008-09-25 11:56:21" So Date.today would get you all records of today, including those from the morning to now. Time.now includes the tim

[Rails] Fat Model Thin Controller

2008-09-25 Thread bingo bob
I'm trying to follow Fat Model Thin Controller, and generally just do things right as much as possible and need some help at this early stage of development. I have some users (courtesy of restful_authentication). I’ve got my relationships such that a User has_many Adverts and an Advert belongs

[Rails] Re: How to find records, placing conditions on joined table?

2008-09-25 Thread Erol Fornoles
On Sep 25, 5:22 pm, Carmine Moleti <[EMAIL PROTECTED]> wrote: > Hi to everyone, > > I have my User model which has_many roles. > Now, I've the need to find all users with certain roles. > > At first I thought of something like > > User.find(:all, :joins => :roles).select { |u| u.has_role?(:admin)

[Rails] Re: updated_on broken

2008-09-25 Thread Maarten Porters
Hey Jeffrey, I did indeed update to rails 2.1 recently ... It really makes sense because I was probably updating associated models. Forcing updated_on = Time.now fixed the problem. Thanks Jeffrey -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~

  1   2   >