Hi,
Yes, and Marnen's observation in a later message about not needing to pass
row is spot on.
Regards,
Craig
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.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@googlegroups.com
When you browse to http://localhost:3000 , public/index.html will be
rendered. What does your public/index.html look like? Is it producing a page
with no visible content?
Regards,
Craig
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.com
You can add columns to your table using
migrationshttp://railscasts.com/episodes?search=migrations.
Rails Guides http://guides.rubyonrails.org/ is a good place for getting
started with newer versions of Rails. You'll have to manually add the fields
to your view, though.
Regards,
Craig
--
Craig
what purpose they
serve in the calculation.
Then your loop could be:
Model.all.each do |model|
model.recalculate_total
model.save!
puts ...
end
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.com
--~--~-~--~~~---~--~~
You received
on that
record.
Regards,
Craig
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.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
If you're on Rails = 2.1, you can track attribute changes:
http://api.rubyonrails.org/classes/ActiveRecord/Dirty.html
You might also like Ryan Bates' screencast on the topic:
http://railscasts.com/episodes/109-tracking-attribute-changes
Regards,
Craig
--
Craig Demyanovich
Mutually Human
and
requires more effort to start a project. I can't articulate more than that
right now. Maybe you can take a similar approach. Also, I wonder if the guys
at http://www.softiesonrails.com/ have any insights or opinions.
Regards,
Craig
--
Craig Demyanovich
Mutually Human Software
http
Perhaps this article [ http://www.infoq.com/news/2009/04/fubu-mvc ] on
FubuMVC, an alternative MVC implementation in ASP.NET, might be of
interest, since it includes some reasons that the creators of FubuMVC prefer
it to Microsoft's MVC implementation for ASP.NET.
Regards,
Craig
--
Craig
You can call set_primary_key:
class MyModel ActiveRecord::Base
set_primary_key us_id
end
See:
http://www.railsbrain.com/api/rails-2.3.2/doc/index.html?a=M002340name=set_primary_key
Regards,
Craig
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.com
it -- how would you suggest I tackle this? Any advice would be great.
Elle
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk
Now I run those two lines of code in the terminal but nothing happens.
When I say nothing happens I mean there is no ouput. I am expecting to
see a break down of the someobj object
--
Posted via http://www.ruby-forum.com/.
--
Craig Demyanovich
Mutually Human Software
http
I think you'd do something like this:
Topics.find(:all, :conditions = [expiration_date ?, Time.now + 1.hour])
See
http://www.railsbrain.com/api/rails-2.2.2/doc/index.html?a=M001891name=findfor
more examples.
Regards,
Craig
--
Craig Demyanovich
Mutually Human Software
http
There's a :purge task in databases.rake in vendor/rails/railties/lib/tasks.
You'll wan to find a way to avoid calling that when running tests.
I'm interested to see what ideas others might share.
Regards,
Craig
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.com
not fetch any updates.
Can anyone please advise?
I do
script/plugin install --force git-repo-url
Craig
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
rails:update.
Regards,
Craig
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.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
ApplicationController
def hello
end
end
and you're still getting an error?
--
Craig Demyanovich
Mutually Human Software
http://mutuallyhuman.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post
On Fri, Feb 27, 2009 at 1:20 PM, Tony Tony rails-mailing-l...@andreas-s.net
wrote:
Hi all,
I'm ashamed to ask this but I can't figure it out. Lately my brain gets
more burned out by the minute. Basically I'm trying to have a shirt have
up to 2 colors. I currently have this working. When I
On Fri, Feb 27, 2009 at 2:33 PM, Tony Tony rails-mailing-l...@andreas-s.net
wrote:
Thanks for the replies!
Craigs solution worked like a charm.
Cool.
First time I use foreign_key. I have a feeling that while this worked,
the way it works (specifically having to specify foreign_key) is
(vendoring rails instead of relying on
2.3 early release gems)
6. play w/ the app
By the way, if you'd prefer something other than sqlite3 as a db, do this in
step 3
$ ruby rails/railties/bin/rails dummy -d mysql
see rails --help for more options
Regards,
Craig
--
Craig Demyanovich
Mutually Human
On Thu, Feb 26, 2009 at 9:35 PM, Tim mcintyre@gmail.com wrote:
Has anyone successfully used attachment_fu with rails 2.3 nested model
forms?
Yes.
I've never used attachment_fu before so I may be doing something wrong
there not sure. Here's what I've got:
class Product
If you can move to Rails 2.3, which is currently in release candidate
testing, you could use default scoping:
http://ryandaigle.com/articles/2008/11/18/what-s-new-in-edge-rails-default-scoping
Regards,
Craig
--~--~-~--~~~---~--~~
You received this message because
You should try both and report back. :-)
Regards,
Craig
--~--~-~--~~~---~--~~
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
You could use #send. Try something like this:
(0..2).each do |i|
example.send(spec_#{i}_english=, test value)
l.save
end
Do you really want l.save instead of example.save, though? Maybe there's
some context missing from your code snippet.
Regards,
Craig
I'm no CSS expert by any stretch of the imagination. However, I do have one
bit of advice: don't name classes based on attributes, such as color;
instead, name classes for what they are. For example, don't create a class
named blue_table; rather, create one named line_items, if that's what you're
To bulk-load a database, I'd use the tools provided by the database. With
mysql, you'd do something like this (assuming that you're logged in to the
database server):
$ mysql -u [username] -p [database] [file]
For example:
$ mysql -u craig -p hockey_development players.sql
The -p flag will
There's a good write-up here:
http://www.regular-expressions.info/numericranges.html
While not specific to matching an IP address, it does cover how to match
ranges like 0-255.
Regards,
Craig
--~--~-~--~~~---~--~~
You received this message because you are
On Thu, Jan 15, 2009 at 3:50 PM, neridaj neri...@gmail.com wrote:
Hello,
I'm following Dan Benjamin's install tutorial and got stuck at the gem
install. It looks like it installed successfully but the gem command
is not recognized. I located another rubygems install from macports at
On Tue, Jan 13, 2009 at 9:37 AM, sa 125 rails-mailing-l...@andreas-s.netwrote:
...
For example, I have a product model, and I want a method called stocked?
that will return 'yes' or 'no' depending on an in_stock boolean field
for the model:
class Product ActiveRecord::Base
def
If you post specific problems, I'm sure folks here will try to help. You
might also check out the deployment group:
http://groups.google.com/group/rubyonrails-deployment
Regards,
Craig
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Pass the regex to String#scan, which will return an array of matches. Check
the docs for details.
Regards,
Craig
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send
You should use validates_inclusion_of. See:
http://www.railsbrain.com/api/rails-2.2.2/doc/index.html?a=M001821name=validates_presence_of
Regards,
Craig
On Mon, Jan 12, 2009 at 5:53 PM, Taylor Strait
rails-mailing-l...@andreas-s.net wrote:
This almost feels like a bug to me, since false is
I don't know about engines (I started w/ Rails after they fell out of
style), but the general advice I recall reading is that you should upgrade a
little at a time. For example, say you're on 1.2.3. You'd upgrade to to
1.2.6. Once you're running well there, you could go to the latest 2.0.x
Generally, don't edit migrations. Instead, write a new one. See
http://guides.rails.info/migrations.html for more details.
Regards,
Craig
On Wed, Dec 31, 2008 at 12:21 AM, Zhao Yi
rails-mailing-l...@andreas-s.netwrote:
There is a table existed in sqlite3 database. I want to change a column
Here's a more specific URL:
http://guides.rails.info/migrations.html#_changing_migrations .
Craig
On Wed, Dec 31, 2008 at 12:31 AM, Craig Demyanovich
cdemyanov...@gmail.comwrote:
Generally, don't edit migrations. Instead, write a new one. See
http://guides.rails.info/migrations.html for more
On Fri, Dec 19, 2008 at 12:20 PM, DAZ daz4...@gmail.com wrote:
Hi,
What is the best way to delete all members of a model?
For example I have a tasks model and want to put a link in that will
delete all tasks at once. Something like,
@tasks = Task.all
@tasks.each { |task| task.destroy }
Run
$ which prince
to determine where prince is installed. Then run
$ echo $PATH
to determine your $PATH.
The path given by running `which` should be in the list of paths given by
$PATH. Is it?
Regards,
Craig
--~--~-~--~~~---~--~~
You received this message
$ rake -T rails
shows an update task but not an upgrade one (in my 2.1.1 app). The
rails:update task only updates configs, scripts and public/javascripts from
Rails. It doesn't update Rails itself. If you have Rails in vendor/rails,
then you'll have to replace that w/ 2.2.2. If you're depending
Email templates change very rarely on my project, so I don't mind the usual
approach of matching the body against a few patterns. And, it's easy to do.
Anyway, here's an example spec of a mailer on my current project:
describe Mailer, job application submitted do
before(:each) do
@user =
You might be able to use ar-extensions [
http://www.continuousthinking.com/tags/arext] [
http://github.com/zdennis/ar-extensions/tree/master] from my friend and
colleague, Zach Dennis.
Regards,
Craig
--~--~-~--~~~---~--~~
You received this message because you are
You wrote that you're running Vista 64-bit and
mysql-essential-5.0.67-winx64, yet the gem seems to be for win32:
mysql-2.7.3-x86-mswin32. Could it be that you need a mysql gem for win64 (is
there one?) or that you need to run mysql for win32 instead of win64? Just
guessing really, since I don't
You can pass the :disabled option to FormTagHelper#check_box_tag or
FormHelper#check_box to render an uneditable checkbox.
Regards,
Craig
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To
In my current project, I'm using the regexp from
http://www.regular-expressions.info/email.html with validates_format_of to
validate email addresses.
Regards,
Craig
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I once read that, if you're upgrading from a release that is several
releases or a major release behind your target version, i.e., 1.x to 2.x,
you should upgrade gradually. Say you're on 1.2.2.
1.2.2 - latest 1.2.x release
latest 1.2.x release to latest 2.0.x release
latest 2.0.x release to
On Sat, Nov 1, 2008 at 5:29 AM, hoenth [EMAIL PROTECTED] wrote:
i have a person object. Persons don't need to have addresses, but if
they have any address field value, they must have them all. So I have
something like this:
validates_presence_of :street_address, :city, :state, :postal_code
Rails checks the RubyGems version using Gem::RubyGemsVersion. I launched IRB
and queried the version:
$ irb
Gem::RubyGemsVersion
= 1.2.0
What does yours report?
Based on the error message that you received, I expect it to report an empty
string.
I'm on Mac OS X 10.5.5 using the built-in Ruby,
There's the annotate models plugin:
http://agilewebdevelopment.com/plugins/annotate_models . I don't know
whether it works with recent versions of Rails.
Regards,
Craig
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Whenever I've needed to export data for Excel, I've always exported a CSV
file, since it's quite easy to create and easy for Excel to open. I've used
FasterCSV to generate the CSV file.
Regards,
Craig
--~--~-~--~~~---~--~~
You received this message because you are
It's risky to just delete the classes, since you're altering your install of
Ruby. There must be a way to ensure that the classes from the gem are used
that preserves your Ruby installation.
Craig
--~--~-~--~~~---~--~~
You received this message because you are
On Fri, Oct 24, 2008 at 10:59 AM, Bensoussan Michael [EMAIL PROTECTED]wrote:
My array is composed by different activerecord objects:
my_model1 = Model.find(:all)
my_model2 = Model.find(:all)
@my_models = my_model1 + mymodel2
and now i'd like to sort @my_models by created_at
@my_models
Since the after_update is declared in your Ticket model, you should be able
to access the params hash from the method. For example
class Ticket ActiveRecord::Base
...
after_update :record_changes
...
private
...
def record_changes
TicketChange.create!(params[:comment],
It sounds like your app is relying on the gems installed on the production
server. Instead, you should consider bundling your gems with your app. Good
coverage of gem dependencies is here [
http://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies]
and here [
I haven't faced such a problem before. Are you able to visit that URL in
your browser and see the WSDL? If you can, then at least you know that the
URL is good and that the problem is in your code or the soap4r library.
Regards,
Craig
--~--~-~--~~~---~--~~
You
I know very little about SUSE, but could this thread be helpful?
http://www.mail-archive.com/[EMAIL PROTECTED]/msg01833.html
Yes, it's about capistrano, but it involves making SSL work w/ Ruby on SUSE.
Regards,
Craig
--~--~-~--~~~---~--~~
You received this
D'oh. I should more carefully reply to posts after just waking up. I don't
know how I mixed controllers and models this morning. Time to enjoy the MVC
public service announcements http://www.railsenvy.com/tags/MVC again.
Sorry for the confusion everyone.
Craig
A Google search for
rails import csv
returns several promising results.
Regards,
Craig
--~--~-~--~~~---~--~~
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
On Tue, Oct 21, 2008 at 11:06 AM, sukury47 [EMAIL PROTECTED] wrote:
% for reserve in @plan.reserves %
This line make error like this 'uninitialized constant Plan::Reserf'
I already have plan and reserve model
and I define their relationship.
plan
has_many :reserves
reserve
On Wed, Oct 22, 2008 at 12:05 PM, Sven [EMAIL PROTECTED] wrote:
So something like this, perhaps:
class Post ActiveRecord::Base
named_scope :current_as_of, lambda { |time|
{ :conditions = ['do_not_show_before ?', time] }
}
def self.current(time = Time.now)
Actually, you could do something like this:
named_scope :current, lambda { |*args| { :conditions =
['do_not_show_before ?', (args.first || Time.now) ] } }
I knew Ryan Bates' screencast on named_scope covered defaults. See:
http://railscasts.com/episodes/108 .
Regards,
Craig
On Wed, Oct 22, 2008 at 12:57 PM, Sven [EMAIL PROTECTED] wrote:
Yes he did. I hadn't seen that one and didn't think of checking it.
Ryan suggests exactly what you've proposed; I've tried it and it
works. Thank you! This is much cleaner, and I get to keep using the
named_scope instead of a
I'm a little confused by your example. Do you mean posts instead of
channels? :show_in_category is on Post, correct?
Assuming posts and :show_in_category on Post, couldn't you just add a second
named_scope to Post, show_in_category (for lack of a better name)?
class Post ActiveRecord::Base
On Wed, Oct 22, 2008 at 1:43 PM, Sven [EMAIL PROTECTED] wrote:
...
This lets me use the named scope instead of a method but the semantics
aren't right. I'm trying to express the notion that active
category.posts are subject to an additional restriction relative to
active posts. I'm not
error_messages_for 'customer'
by convention looks for @customer. In your controller action, you need to do
def checkout
@customer = Customer.new
end
Once you have error_messages_for working, you can view the source of your
page to see that error_messages_for generates specific markup for the
I don't have any experience with general log analyzers. For performance, one
option is New Relic's RPM [ http://newrelic.com/ ]. They offer free and paid
services. I've also used two nice exception loggers, Hoptoad [
http://hoptoadapp.com/ ] and Exceptional [ http://getexceptional.com/ ]. I
like
If you rename the call variable in your block to, say, phone_call, does that
make a difference? I can't find call on the reserved word list for Ruby or
Rails, but I wonder if it's just somehow problematic to use it.
Regards,
Craig
--~--~-~--~~~---~--~~
You
total = @array.inject(0) { |sum, value| sum + value }
The inject method comes from the Enumerable module, which Array includes.
Docs are here: http://ruby-doc.org/core/classes/Enumerable.html#M003160 .
Regards,
Craig
--~--~-~--~~~---~--~~
You received this
On Mon, Oct 20, 2008 at 4:55 PM, Fernando Perez
[EMAIL PROTECTED] wrote:
I am playing with newrelic, but there is something bothering me: the
graphs don't take into account the number of times an action has been
called, it only looks at its average response time.
Well this is a wrong
On Mon, Oct 20, 2008 at 6:30 PM, Fernando Perez
[EMAIL PROTECTED] wrote:
I guess it is fairly easy for RPM to count the number of times an action
was triggered. It's probably part of their paid service.
I am still in search for a good profiling tool that can tell me in a
clear manner,
At least one of the numbers needs to be a float. Here's an example of
script/console output:
Loading development environment (Rails 2.1.1)
3/2
= 1
3.0/2
= 1.5
3/2.0
= 1.5
3.0/2.0
= 1.5
In Ruby, division of integers returns only the integer part of the result.
Craig
Could you share a backtrace of one of the errors that you're seeing?
Craig
--~--~-~--~~~---~--~~
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
A colleague of mine dealt w/ something like this awhile ago. He removed all
error messages for tasks and added a custom one that more clearly
communicated the situation to the user. He said that you can treat the
errors object as an array, so see the docs for Array#delete to delete all of
the
71 matches
Mail list logo