When i use Model.all and i want to save this one value into all the
rows of the model how do i do it without using a "for" loop.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to
This is my table
model name is bids
id | bid | keyword
1 | 2 | orange
2 | 3 | orange
3 | 1 | red
4 | 3 | blue
5 | 6 | red
what i want is the get these the top bidder of each unique keyword in
one .find statement
--~--~-~--~~~---~--~~
You rec
I am using the daemons plugin.
I have just one problem how do i add modules from the /lib folder to
the /lib/daemons/daemon.rb file
eg. /lib/basic_functions.rb
this is the file i want to load in daemon.rb
contents daemon.rb:
#!/usr/bin/env ruby
# You might want to change this
ENV["RAILS_ENV"
with rails 2.2.2 action mailer requires a valid ssl certificate
i have a question about routing
my smtp settings for my postfix are now
ActionMailer::Base.smtp_settings = {
:address => "smtp.mydomain.com",
:port => 25,
:domain => "mydomain.com",
:authentication => :plain,
:user_name => "mydomain
Hi,
I am having problems configuring my actionmailer to work with postfix.
I followed this tutorial:
http://howtoforge.org/virtual-users-and-domains-postfix-courier-mysql-centos5.1
and i got the server set up.
at first i fixed the mail settings to work with gmail using this
tutorial:
http://
Hi,
i am having a very weird problem i have an array
Model:
serialize :marketarray
Controller
@marketobject = Market.find(1)
@marketobject.marketarray = ["red","blue","green"]
I do this @marketobject.marketarray.slice!(0)
@marketobject.save!
but it does not change the Market.marketarray t
I have been trying to change the font size in the select_date but i
haven't had any luck
here's what i did:
<%= select_date( Date.today, :prefix => 'prom_date_end', :order =>
[ :day,:month, :year], :html => {:style => "font-size: xx-small;"}) %>
--~--~-~--~~~---~--~--
Hi when ever i do
rescue Exception => e
flash[:error] = e.message
the e.message will always contain the "Validation error:" string and
the Object
Example:
Validation failed: Price "message:", Price "message"
How do i tell rails that I just want the message? and
Hi, i was just wondering if its is possible to put a if statment
inside the find conditions
for example:
grovery_price = model.find(:first, :conditions => [ "if x = ? then y
must = ?", 200, 300]
I have been googling for some time for a solution to this but i just
can't seem to find any.
--~--~
Hi,
I have tried creating a not equal condition in the find statment but
it just outputs an empty array.
model.find(:first, :conditions => [" id = ? AND market = ? AND
promotion <> ? " , id , name, "y"],:order => 'id desc').price
I have tried != instead of <>
I have tried googling for the answ
How do i change the ajax failure message
<% remote_form_for(:comment, :url => grocery_comments_path(params
[:id]),
:html => { :id => 'new_comment_form' }, :method => :post, :update =>
{ :failure => "error" }) do |form| %>
the :update => { :failure => "error" }
gives me the usual error m
Never mind i got it
@comment.body = "" before the page.replace
On Nov 1, 1:34 am, tyliong <[EMAIL PROTECTED]> wrote:
> Hi, after i click submit and refresh the parital(with
> page.replace_html) with the remote_form_for, the <%=
> form.text_area :body, :rows => 10
Hi, after i click submit and refresh the parital(with
page.replace_html) with the remote_form_for, the <%=
form.text_area :body, :rows => 10, :cols => 40 %> still contains the
previous text. how do i totally remove the text inside of it?
--~--~-~--~~~---~--~~
You re
Hi, I am a noobie. I just want to know what is the standard or most
effective way of doing this
I have two functions
def display_price(grocery,batch)
grocery_price = grocery.send(batch).price
if grocery_price
number_to_currency(gro
ke
> > > Sent: Wednesday, August 27, 2008 10:18 PM
> > > To: Ruby on Rails: Talk
> > > Subject: [Rails] Re: protect_from_forgery :only => [:create, :delete,
> > > :update] what does this do exactly?
>
> > > (3)If it is that good should i use i
never mind i solved it
On Sep 23, 4:46 pm, tyliong <[EMAIL PROTECTED]> wrote:
> Hi, when i use the updatepassword action, it does not refresh the ajax
> partial but forces the browser to save a file
> why does that happen?
>
> def updatepassword
> @user =
Hi, when i use the updatepassword action, it does not refresh the ajax
partial but forces the browser to save a file
why does that happen?
def updatepassword
@user = current_user
return unless request.post?
if User.authenticate(current_user.login, params[:old_password])
(irb):30
On Sep 7, 11:14 pm, tyliong <[EMAIL PROTECTED]> wrote:
> Hi, i am having problems displaying a simple attribute. what is weird
> is that all the other attributes are can be called but not .p . I
> have been racking my brain on why but I just don't get it. it doesn
Hi, i am having problems displaying a simple attribute. what is weird
is that all the other attributes are can be called but not .p . I
have been racking my brain on why but I just don't get it. it doesn't
make sense i can call nearly every attribute except this one
DB creation code:
creat
undefined method `[]' for #
meaning that theres something wrong with groceries.price
but in the migration file .price is specified to be
t.decimal :price, :precision => 8, :scale => 2
I don't understand why rails is giving an undefined method
when i subsitute in decimals for 1 and
Hi!
the array is like this
[[1,"h"],[2,"g"]]
i want to select the parts of the array with the minimum value
and show the 2nd part of the element only meaning the strings like "h"
and "g"
i've tried this but it doesn't work
x.select{|c| c.first = [x.min{|a,b| a.first <=> b}.first]}.last
and i ge
solved
On Sep 6, 4:16 pm, tyliong <[EMAIL PROTECTED]> wrote:
> Hi,
>
> usually when i do this:
>
> x = [1,2,3,]
>
> result = x.min
>
> but let's say I have a nested array
>
> x = [ [1,"h"], [2,"c"]]
&g
Hi,
usually when i do this:
x = [1,2,3,]
result = x.min
but let's say I have a nested array
x = [ [1,"h"], [2,"c"]]
how to i just display the min value (1) and its pair value "h"
--~--~-~--~~~---~--~~
You received this message because you are subscribed to t
23 matches
Mail list logo