The scaffold generator takes a model name, followed by an optional
space-delimited list of field name:type specs. So you might say:
script/generate scaffold Book name:string description:text price:decimal
Or you can leave off the list of field names (in which case you don't get much
in your
> On Dec 4, 6:33 pm, Jim Knowlton wrote:
> > I am a QA engineer who works in Ruby quite a bit, and I've never been
> > able to figure out...why is there a disproportionately large
> > contingent of Mac users among Ruby developers? Macs are probably 10
> > percent of the computer market, but every
Something like...
# views/subject/show
<%= link_to 'Would you like to add one?', new_book_path, {:subj => @subject}
%>
# controllers/books_controller
def new
@book = Book.new
@book.subject = params[:subj]
# etc...
end
HTH,
-Roy
-Original Message-
From: rubyonrails-t
I think you want to use the fields_for helper so rails will give you an array
of form params to hold the various items. You should also probably include a
hidden text field in there to hold the id of each item so you know which
quantity should go w/which item.
HTH,
-Roy
-Original Messag
Hey All,
I'm attempting to upgrade my app from rails 2.0.2 to 2.3.3. One bit that's
failing is this call here (in /views/projects/show.html.erb)
<%= markdown(@project.description) %>
That earns me a:
uninitialized constant ActionView::Helpers::TextHelper::Markdown
On that line.
I'm on
If you give the cookie a long lifespan, you won't need the extra formatting
preference stuff on the end of the URL.
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of Michael Schuerig
Sent: Thursday, July 16, 2009 1:04 AM
T
AD (at least) can be used on other platforms to automatically authenticate a
connection w/out prompting the user for credentials. If RoR could use it that
way it would amount to single-sign-on I think.
Can RoR & its typical deployment stack not use AD like that?
(I'm seriously asking, in case
Right--you typically bring a stylesheet file into your app w/goo like this in
the layout:
My Cool App: <%= controller.action_name %>
<%= stylesheet_link_tag 'my_stylesheet' %>
You can bring as many stylesheets as you want into your layout. So e.g., this
will work:
<%= stylesheet_l
The OP's e-mail address is @aol.com. So obviously it's someplace in Albania.
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of Marnen Laibow-Koser
Sent: Wednesday, July 15, 2009 10:21 AM
To: rubyonrails-talk@googlegroups.c
> Hi guys,
>
>We have a table named layoff_comments in our database,
>but accidentally we have deleted(lost) all the data from
>this table, we have backup, and we want to restore that
>table, without dropping the current database. Please help
>us.
>
> Thanx in advance.
You'll
I say, scratch an itch of your own. Track something you need to track in your
personal or professional life.
That way you don't have to beat requirements out of anybody (or guess at them).
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups
I believe they're fairly equivalent WRT populating them w/values.
I think the main distinction is whether you're feeding the selected value into
a form that builds a model object or not. If you're in a form_for block, then
select is easier (e.g., it uses the context of the form builder to save
I think the root cause of both issues is the same--the ruby & rails installs
for windows don't include sqlite binaries and/or the associated ruby bindings.
There are excellent instructions for making a functional ruby and rails install
on windows here:
http://blog.mmediasys.com/2009/07/06/gett
> So when you do this:
>
>class Something
> def self.greet
>puts "Hello from #{self}!"
> end
>end
>
> you're defining a method on the object self -- which happens
> to be, at that point in execution, the class object
> Something.
And just to beat the horse a little more,
There may be something of use to you on this page:
http://isitruby19.com/mongrel
HTH,
-Roy
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of Guillermo Acilu
Sent: Thursday, July 09, 2009 5:55 AM
To: Ruby on Rails Li
Never tried it. I think the lack of an adapter is what kills this. I'd be
curious to hear whether the sqlserver adapter in ODBC mode could be fooled into
hitting msaccess w/the right connect string...
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...
Can you post a sample @article.url that results in blank .host output from
URI.parse?
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of Sean Six
Sent: Thursday, May 28, 2009 8:53 PM
To: rubyonrails-talk@googlegroups.com
Su
It's not an IDE, but I really like the 'e' text editor for ruby/rails
development on windows. Google for 'e text editor' & you'll find it. It's a
textmate clone (or started out that way anyway).
HTH,
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrail
Try pointing your config/database.yml at your legacy db & run 'rake
db:schema:dump'. That should dump the current schema out to db/schema.rb.
HTH,
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of JannaB
Sent: Frid
I believe the primary_key directive will tell AR what field to use as the
actual PK. Something like:
class MyClass < AR::Base
primary_key :actual_pk_field_name
end
Hopefully AR would then then ignore the id field.
-Original Message-
From: rubyonrails-talk@googlegroups.com
[ma
Maybe:
<%= link_to lecture.title, lecture.lecture_id %>
?
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of Patrick Heneise
Sent: Friday, May 22, 2009 1:45 AM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] nest
Heh--you're welcome. But please don't let me bully you into dropping rails--I
don't understand your goals as well as you do. ;-) I'm just trying to explain
options. I frankly don't understand rails well enough to know when/how objects
live beyond individual http requesst/response cycles. My
FWIW--you can use AR in a straight ruby program. Frx--something like this
should work I think:
require "rubygems"
require "activerecord"
require "sqlite3"
ActiveRecord::Base.establish_connection(:adapter => 'sqlite', :database =>
'~/my_db.db')
c = ::ActiveRecord::Base.connection
If I was you I'd ask how to do this over on comp.lang.ruby. My guess is you'll
have a better time doing this entirely outside of rails.
BTW--the first appendix of the pickaxe book covers ruby's socket library. If
you haven't already looked at that, there could be some useful stuff in there...
At the risk of being nitpicky, @@variables are not globals--they are class
variables. Globals vars start with a $.
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of Colin Law
Sent: Thursday, May 21, 2009 9:30 AM
To:
I think this is the tool you mean:
http://agilewebdevelopment.com/plugins/annotate_models
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of Perry Smith
Sent: Wednesday, May 20, 2009 1:24 PM
To: rubyonrails-talk@googlegrou
First, consider whether it's worth worrying about this--it may be that rails'
and/or the db's caching mechanisms make this not such a perf issue.
That said, would it be feasible to not store this record in the db at all?
Just make the constant a free-standing AR object? Something like:
class
Sazima's exactly right. When you're getting your "sea legs", ignore what the
cool kids are doing and just learn the basics of the platform. Get yourself a
book, install the version of rails it covers, dig in & write an application or
two.
Once you've got some experience under your belt you'l
I don't know if you can get there just w/HM=>T, but you can fake out the last
link w/a custom method. This is working for me:
class Article < ActiveRecord::Base
belongs_to :feed_entry
end
class FeedEntry < ActiveRecord::Base
belongs_to :feed
has_many :articles
end
class Feed < ActiveRec
Hey All,
My app keeps track of /people. A Person has a .typical_role property, which
(right now) takes one of the following values: ["Programmer", "Investigator",
"Project Manager", "Other"].
What's the best/easiest/neato-cool way to allow users to specify which subset
of people they want to
How about a class method that takes the to-become-featured project as an
argument? Something like:
class Project < AR:Base
validates_uniqueness_of :featured
def self.make_featured(this_project)
self.update_all("featured = false")
this_project.featured = true
this_project.save!
I suspect something like this could work--may be worth a shot.
# Models
class Table < AR:Base
has_many :column_groups, :order => 'cg_num'
has_many :rows, :order => 'rownum'
def columns
self.column_groups.map {|cg| cg.columns}
end
end
class ColumnGroup < AR:Base
belongs_to :table
feature works in FF but not IE
Pardee, Roy wrote:
> <%= observe_field('project_search',
> :url => { :controller => "projects", :action => "index_search"},
> :update => "project-list",
> ...
> That partial renders a ta
Hey All,
I put a simple search box on my projects/index view, via the following
observe_field call:
<%= observe_field('project_search',
:url => { :controller => "projects", :action => "index_search"},
:update => "project-list",
:loading => "Element.show('search_spinner')",
:com
Saturday, January 24, 2009 7:41 AM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Re: cycle() not cycling in a partial
Pardee, Roy wrote:
> I've got the below partial rendering each item of a collection to a table
> row, with some nice ajax magic for hiding the row if the use
Hey All,
I've got the below partial rendering each item of a collection to a table row,
with some nice ajax magic for hiding the row if the user clicks a link. It
works very nicely, except for the bit that assigns the class= attribute to the
tr tag. For some reason I can't figure out, every
Ah, of course--thanks! I do want an instance method I think--want to call the
generics from instance methods in the class. I will experiment.
Thanks!
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of Joshua Abbot
clude MyModule
end
That seems to be a very neat and clean way to juggle these methods and DRY up
your model code somewhat.
-- Josh
http://iammrjoshua.com
Brandon Keepers wrote:
> On Wed, Jan 14, 2009 at 8:26 PM, Pardee, Roy wrote:
>> kid.attributes = atts
>> I'd l
Hey All,
I find I'm writing a ton of nearly identical model methods to support mass
creation/update of child objects (a la the 'complex forms' series of
railscasts). Stuff like:
def existing_child_attributes=(updated_kids)
children.each do |kid|
unless kid.new_record?
atts
x = @results.empty? ? 1 : 0
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of James Bond
Sent: Tuesday, January 13, 2009 11:42 AM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Re: Number of entries
How can I wri
Can't resist adding this gratuitous and unsolicited advice:
If an application can only have one status at a time, resist any urge you might
feel to store status in a series of boolean fields in applications. Instead,
have your controller just store the id of the selected status in
application
Try something like:
def create_visit(for_patient)
# This populates patient_visit.patient_id w/the proper id value
patient_visit = for_patient.visits.new
# Note that I've changed the action from index to new--that's
# the convention for actions that create new objects.
redi
I think the first doublequote around "red" is terminating the string in the
first part of your ? : expresion. If it were me, I'd verbose that out some:
<% if @tour_request.booked_datetime then %>
Confirmed For:
<%= @tour_request.booked_datetime %>
<% else %>
Date and time r
title= tag attributes maybe?
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of Scott Kulik
Sent: Wednesday, December 17, 2008 9:18 PM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] anyone know a good way to do a cap
In the olden days we would do this sort of thing with db triggers and a
'journal' table--every UPDATE would result in a record_version field being
incremented, and the pre-update version of the rec written out to a separate
table. You can also keep all record versions in one table & put up a vi
Try setting an environment variable like so:
http_proxy=http://my.proxy.server.mycompany.com:port_number
With the appropriate URI to your proxy server of course.
HTH,
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Nicolas Alpi
Sweetness--thanks!
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Frederick Cheung
Sent: Thursday, November 27, 2008 4:59 AM
To: Ruby on Rails: Talk
Subject: [Rails] Re: error w/dynamic fixtures
On Nov 26, 10:49 pm, "P
Ah, that scratched an itch for me--thanks for posting that.
Cheers,
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
David A. Black
Sent: Sunday, November 30, 2008 12:39 PM
To: Ruby on Rails: Talk
Subject: [Rails] Re: The verdict on
Hey All,
I'm trying to do the basic test/unit stuff & having trouble w/a dynamic fixture
error. I'm running rails 2.0.2 on windows.
I have statuses & projects. Projects belong_to status and so forth.
# statuses.yml ===
active:
name: Active
description: MyString
# project
Hey All,
I've got a couple of valid-value lists that I would keep as arrays in the
appropriate model. So for instance:
class Person < ActiveRecord::Base
ROLE_NAMES = ['Admin Assistant', 'Programmer', 'Investigator', 'Project
Manager', 'Other']
# blah blah blah
end
Now I need to c
You can also do
Time.now.year - other_date.year
Cheers,
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
gsterndale
Sent: Thursday, November 20, 2008 11:26 PM
To: Ruby on Rails: Talk
Subject: [Rails] Re: Getting the number of yea
Scaffolding is still built-in, but it won't look for existing tables when it
builds the views. You've got to list out all your column_name:column_type
pairs on the call to script/generate.
It's a bummer, but there it is...
From: rubyonrails-talk@googlegroups.co
This may just be superstition talking, but I wonder if the problem is the names
"from" and "to". Any difference if you make those, e.g., "from_date" and
"to_date"?
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Shandy Nantz
Sent: Thur
I think Fred's given the preferred idiom. It's simple & it works.
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
James Byrne
Sent: Wednesday, November 05, 2008 12:03 PM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Re: select i
for the responses.
- Justin
On Nov 4, 11:55 am, "Pardee, Roy" <[EMAIL PROTECTED]> wrote:
> But is a plugin really required? Can't you feed something to find_by_sql
> that will get you both types of objects?
>
> -Original Message-
> From: rubyonrails-
But is a plugin really required? Can't you feed something to find_by_sql that
will get you both types of objects?
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Frederick Cheung
Sent: Tuesday, November 04, 2008 1:32 AM
To: Ruby on Rail
Thanks! I wondered about that. Does OpenID do actual single-sign on, or is it
more that you can use the same credentials from site to site?
I think if I put my app out in the wild I'll try to do openid. The trick will
be getting the contractor to make that an option for the plone site. They
http://www.noobkit.com/show/ruby/ruby/ruby-core/hash/invert.html
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Neal L
Sent: Monday, November 03, 2008 2:35 PM
To: Ruby on Rails: Talk
Subject: [Rails] Reverse keys and values in a hash
H
Hey All,
My group has a plone-based public web portal thingy that a contractor provides
for us, w/all the usual CMS goodies (contacts; news items, hierarchical folder
structure, etc.).
Quite independently of that, they asked me to create a project/collaboration
tracking application (who's inv
Well don't leave us hanging--how'd you fix it? ;-)
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Jamal Soueidan
Sent: Thursday, October 30, 2008 7:35 AM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Re: X is not missing constan
I think ActiveRecord will expect this join condition to work:
on members.id = invitation.member_id
Would that work on your data?
I think that in both of those association declarations, the :foreign_key
argument names the field in the child table that should be linked to the pk of
the parent
You can create a pointer to your display_price method with a Proc object, e.g.:
this_func = Proc.new {|groc, bat| display_price(groc, bat)}
loop(this_func, batch)
Your loop method invokes the actual function with the .call method, e.g.:
def loop(func, matrix)
# Note that .each will a
Huh--interesting, those two has_many :games calls in your Team class there.
Does that result in a single @my_team.games collection property that gives the
complete list of games, whether they were team_a or team_b? My intuition is
that the second call would sort of overwrite the first & you w
Could the inclusion of the games records be multiplying the number of teams
that get returned maybe? Any difference if you take :games out of that
:include array there?
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Thierry Delbart
Se
http://www.noobkit.com/show/ruby/rails/rails-edge/activerecord-edge/activerecord/base/find.html
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Thierry Delbart
Sent: Friday, October 24, 2008 12:49 PM
To: rubyonrails-talk@googlegroups.com
Agree that scaffolding in 2.x is unnecessarily hobbled. FWIW--here's what I
wound up doing:
http://helloimbloggingatyounow.blogspot.com/2008/03/i-am-leet-rails-haxor.html
or if that breaks:
http://is.gd/4IRI
It's worked reasonably well for me.
-Original Message-
From: rubyonrails-ta
Yikes. Good luck with that. ;)
The only thing that comes to my mind is the :locals hash you can pass in a call
to render :partial. But it'd probably be as much of a pain to figure out how
to have your transliterator make those calls as it would be to have it put
variable creation code in the
Ah, so you've got a grandchild object (sector). I just had a parent & one
child. I bet you are close. Try this:
@news_items = NewsItem.find(:all, :order => order_by, :include => ['stock',
'sector'])
and in the view:
<%= sort_link('Sector Name', 'sectors.name') %>
(So--singular forms i
I would think partials would serve you (laying out vars populated in the
appropriate controller).
Have you looked at those at all?
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Christo Karlson
Sent: Wednesday, October 22, 2008 3:10 PM
You shouldn't have to worry about that. In this code:
Product.transaction do
@product.save! #<-- this saves the product, retrieving the
db-assigned ID
@details.product = @product #<-- this writes @product.id to
@details.product_id
@details.save! #<-- this sav
You want general db design, or design of a system that does access control via
roles?
(For the former, I like _Database Design For Mere Mortals_ by Hernandez.)
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Chris-Aix
Sent: Wednesday, O
That should go into your layout (apps/views/layouts).
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Heinz Strunk
Sent: Wednesday, October 22, 2008 10:01 AM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Re: 3 different areas, 1
Yeah, that's a problem I haven't actually tackled myself yet. :P If you
notice, I did this:
<%= sort_link('Status', 'status_id') %>
Which does the sort by the numeric value of the id for the status, rather than
the text the user sees. Very bush-league.
So I fixed it just now ;-) like so:
> -Original Message-
> From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
> Of James Salter
> Sent: Tuesday, October 21, 2008 4:42 PM
> To: rubyonrails-talk@googlegroups.com
> Subject: [Rails] Re: Non-Ruby REST client for Ruby REST server
>
>
> fervic wrote:
> > I
How about:
def validate_dealer_id
if number.blank? then
errors.add_to_base("You must specify either a Dealer Number OR a Sub Dealer
Number.") if subnumber.blank?
else
erros.add_to_base("A dealer can't have both a dealer number AND a sub
dealer number") unless subnumber.blank?
end
Well, you can still have those is_whatever? methods--just write them on the
model your own self:
class Child
def is_lost?
self.status == 'lost'
end
def is_found?
self.status == 'found'
end
def is_safe?
self.status = 'safe'
end
end
You could even write your own setters (d
I would go with a single 'status' field.
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Tony Tony
Sent: Tuesday, October 21, 2008 12:59 PM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Boolean database + Site Design/Architecture
In my view I've got:
<%= sort_link('Name', 'name') %>
<%= sort_link('Grant number', 'grant_number') %>
<%= sort_link('Status', 'status_id') %>
The controller starts out with:
def index
order_by = params[:order_by] || 'name'
@projects = Project.find(:all, :order => or
I believe you can also do:
@states = States.find_by_country([LOCALE, 'International'])
Worth a try...
Cheers,
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Schalk Neethling
Sent: Tuesday, October 21, 2008 5:12 AM
To: rubyonra
I use this helper:
def sort_link(show_text, sort_by)
link_to show_text, {:action => 'index', :order_by => sort_by}, :class =>
'big-link', :title => "Sort by #{show_text}"
end
One thing I haven't done & would like to is to have the app 'remember' what the
previous sort order was, so tha
Does anybody else get the heebie-jeebies at the thought of running a web app
under a user account w/perms enough to create FTP users? ;-)
Have you considered other methods for empowering your users to move files back
& forth to your server (e.g., attachment_fu)? If that would suit, you'll
pro
Looks to me like there's about a half a page on XML-RPC, at the beginning of
the chapter on ActiveResource--it's discussed as an alternative to
ActiveResource. Not a ton there...
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
helzer
S
That's a common ruby gotcha. Division of integers results in an integer. To
fix, convert one or both numbers to floats with .to_f or include a decimal
place on the literal (e.g., 3.0/2)
HTH,
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On
y to do this in one query?
> >
> That depends entirely on what's in your can_edit function.
If your controller is doing an Account.find() to populate your @account var,
you may be able to avoid the extra queries by throwing a :include => 'clients'
on there...
> Fre
Do clients have a .selected property or some such that you can use to figure
out which clients are already selected? If so you could do, e.g.,
@account.clients.map{|c| !c.selected}
I would think.
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On
Can you just shell out to whatever command-line tool your database supports for
executing large sql files?
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Joe Peck
Sent: Thursday, October 16, 2008 12:36 PM
To: rubyonrails-talk@googlegrou
Other options include ruby's WIN32OLE and DBI libraries. For the former,
you'll have to be running on a machine w/excel installed. You'd use the latter
on a windows machine to read the spreadsheets in via ODBC. Your connect string
would be *something* like:
connection_string = "dbi:ADO:" +
I think your problem is that you used the plural "courses" on your call to
script/generate scaffold. That generator wants a *singular* noun. So do a:
rake db:rollback
and
script/destroy scaffold courses
followed by a:
script/generate scaffold course title:string description:text
cou
If you want navigation to a URL to actually log a specific person in, the
tokens will have to be person-specific, won't they? What do you imagine the
mechanics would be for getting a sending user to generate one of those URLs?
Are you trading recipient-convenience for sender-inconvenience?
Wo
Google's your friend here. "validate url with regular expression".
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Joe Peck
Sent: Wednesday, October 15, 2008 7:45 AM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Small regular ex
Create an alias like so in your .bash_profile or wherever:
alias rss='ruby script/server --port:80'
HTH,
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Alejandro Mansilla
Sent: Wednesday, October 15, 2008 8:19 AM
To: rubyonrail
ActiveResource is supposed to be good for this sort of thing, isn't it? Can
you use that?
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Nate Murray
Sent: Tuesday, October 14, 2008 1:16 PM
To: Ruby on Rails: Talk
Subject: [Rails] best-
What does the resulting SQL look like in your log?
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
infinteVerve
Sent: Tuesday, October 14, 2008 10:44 AM
To: Ruby on Rails: Talk
Subject: [Rails] Searching - weird behavior with certain lett
Try:
@lost_children = @user.children.select {|c| c.is_lost}
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Tony Tony
Sent: Tuesday, October 14, 2008 6:17 AM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Trying to replac
link_to "click me" :controller => 'some_controller', :action => 'my_action',
:this_recipe_id => @recipe, :this_meal_id => @meal
But depending on where you put that link there are probably shorthands you can
use.
HTH,
-Roy
-Original Message-
From: rubyonrails-talk@googlegroups.com [ma
I believe e.g., Recipe.find_by_diet_id_and_meal_id(12, 34) should work.
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Martin Evans
Sent: Monday, October 13, 2008 8:01 AM
To: rubyonrails-talk@googlegroups.com
Subject: [Rails] Searching o
Nah, you can set a parent from a child. Dig it:
>> hh = Album.new(:title => "Houses of the Holy", :artist => "Led Zepplin")
=> #
>> hhr = Review.new(:title => "Led Zep's new album rocks", :review_body =>
"Best. Album. Ever.")
=> #
>> hh.save
=> true
>> hhr.save
=> true
>> hh
I don't suppose it's as simple as not calling the check_box helper from the
form object you're getting out of fields_for is it? I would guess that's what
would happen if you did...
-Original Message-
From: rubyonrails-talk@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of
Danima
Is this the multiple-models-one-form problem? If so, see this & the prior 2
railscasts:
http://railscasts.com/episodes/75-complex-forms-part-3
The problem that's not treated in those (IIRC) is how to give informative error
messages when child item validation fails. IIRC, you get *something*
One way to make this happen is to do a redirect in the controller after
Model.save or Model.update_attributes rather than a render back to the new or
edit action. Could that be your problem?
(If that's not clear, post the update method of the appropriate controller.)
HTH,
-Roy
-Original
1 - 100 of 132 matches
Mail list logo