Displaying 20 results from an estimated 4000 matches similar to: "input controls on-the-fly ?"
2005 Dec 21
3
Checkbox readonly
I declare some checkboxes :
<%= check_box_tag ''offers[]'', offer.id ,
@params[:offers].include?(offer.id.to_s) ,:readonly=>true %>
the result is :
<input checked="checked" id="offers[]" name="offers[]"
readonly="readonly" type="checkbox" value="1" />
But readonly doesn''t work ???
--
Posted
2006 Jul 01
6
Sorting by an attribute on a associated table
So, I have a User has_many :profiles. The most recently dated profile is
considered the current one. I need to sort these users by name, but the
name attribute is a member of the associated table.
Is there any easy way to do this other than with some ugly find_by_sql?
Maybe a more general question - is there a common solution to sorting in
Ruby?
--
Posted via http://www.ruby-forum.com/.
2006 May 12
4
default value in text field
hi,
This should be really simple, but i cant seem to find the answer
anywhere!!
In my _form.rhtml I have the following text field, how can I define a
default value?
<%= text_field ''purchaseorder'', ''number'' %>
--
Posted via http://www.ruby-forum.com/.
2006 May 10
12
how best to implement lookup table?
Hi all -
I''d like to implement a lookup table in my app that contains some
reference data, just some status codes and their descriptions. What''s
the most appropriate approach according to the "rails way" of doing
things? Would I just implement a has_many relationship? Let''s say
these are Order status codes, would the StatusCode have many Orders?
This
2007 Jul 26
1
Lohan the observable
Sorry, that name is a misnomer. However, I was excited to find that Ruby
has a built in Observable module and I''m pretty bored, so I apologize in
advance....
require ''observer''
# one who is observed
class Celebrity
include Observable
attr_accessor :name
attr_reader :is
def is=(val)
@is = val
changed
notify_observers(self)
end
end
# one who
2006 Jun 12
5
Method in Model
I have a simple method in a model, to send out e-mails via the
script/runner.
def Reminder.dropoff
@messages = Reminder.find(:all, :conditions => [ "time < now()"])
@messages.each do |mes|
Mailman::deliver_send_message(mes)
end
end
However, it''s not sending e-mails.
When this exact code was dropped in a controller, it worked great... is
there
2006 Apr 16
8
"Cannot convert String to Integer" after using association
So, I''ve written a partial that does some stuff with a given instance of
my class "entity". Entity is ActiveRecord. I''m able to retrieve all
sorts of data from an @entity, until I do something like:
<% for @attribute in @entity.attributes %>
<div id="attribute_<%= @attribute.id %>">
<%= render(:partial =>
2006 May 02
9
Visual Migration Design Tool
For a really long time, I''ve been using DBDesigner from FabForce.net.
For those of your who''ve never used it, its a freeware visual
entity-relationship diagram tool, which allows you to make database
designs visually instead of in SQL DDL. You can then use it to generate
the SQL to make your databse design into reality, or even run a
"synchronize" to make any
2005 Dec 22
3
reading long matrix
Hi,
I'm needing some help finding a function to read a large text file into an array in R. The data are essentially presence / absence / na data for many species and come as a grid with each species name (after two spaces) at the beginning of the matrix defining the map for that species. An excerpt could therefore be:
SPECIES1
999001099
900110109
011101000
901100101
110100019
901110019
2006 May 10
12
Strange Behavior on Non-Index Pages
If I browse to \myRoRApp, I get the "Welcome aboard" screen.
I''ve done the ruby scripts/generate controller MyTest, and "Rolling with
Ruby on Rails" tells me I should be able to browse to \myRoRApp\MyTest
and see an error page, but what I''m actually seeing is a fastcgi config
file!
I have installed fastcgi, but apache can''t "see" the
2006 Apr 03
2
HABTM migrations
Bad rails day for Matt-
In a migration, for a habtm:
create_table :teams_users do |t|
t.column :team_id, :integer
t.column :user_id, :integer
end
Ok, fine. In a controller (well really a migration script):
@user.teams << Team.find( 3 )
And the SQL pumped at my server is:
INSERT INTO teams_users (`team_id`, `id`, `user_id`) VALUES (3, 3, 34)
Which
2006 Apr 03
5
Is old school STI broken? How would you do the same now?
So this new STI :through thing is still not clear to me. I have a
project now where I''m using this:
class List < ActiveRecord::Base
belongs_to :user
end
class StaticList < List
has_and_belongs_to_many :items
end
In the script/console:
>> StaticList.create
NameError: uninitialized constant StaticList
What? ok, fine. So a List.create would be in
2005 Jul 13
3
nlme, MASS and geoRglm for spatial autocorrelation?
Hi.
I'm trying to perform what should be a reasonably basic analysis of some
spatial presence/absence data but am somewhat overwhelmed by the options
available and could do with a helpful pointer. My researches so far
indicate that if my data were normal, I would simply use gls() (in nlme)
and one of the various corSpatial functions (eg. corSpher() to be
analagous to similar analysis in SAS)
2007 Jan 26
2
Using functions within functions (environment problems)
Hi everyone,
I've been having difficulty writing wrapper functions for some
functions where those same functions include other functions with
eval()
calls where the environment is specified. A very simple example using
function lmer from lme4:
lmerWrapper <- function(formula, data, family = gaussian, method =
c("REML",
"ML", "PQL", "Laplace",
2006 Jul 30
1
PDF to HTML converter for Ruby?
Does anyone know of a good package that can convert a PDF into HTML?
Cross-platform compatible is a plus, but I can live with Linux-only if
it comes to that.
--
Posted via http://www.ruby-forum.com/.
2006 Jun 11
2
Javascript include in html - load times
Hi,
If I include a javascript library, will it load when the html load, or
just at the first use?
I have table.js and I have few pages that needs it.
Should I include it just on the pages that needs it, or put it on the
application_layout?
Thanks,
Kfir
2006 May 14
2
one to one, but only with one table per record
Hi,
I have a ''descriptions'' table which has_one of lots of other tables.
The other tables all belong to a description. But I only want each
description to have one record from any of the tables. So a
description can''t have a room and photo. There has to be one
description for each room, and one description for each photo. Any
idea if there''s a reasonably easy
2006 May 25
10
One set of source code with multiple instances
Hi there, we made a PHP and Impakt2 based web content management system
for schools with specific features that work really well for schools.
The way I designed it was so there was one central set of source code
and an empty (in terms of rows in tables) database structure. To set up
a new school i had a script that basically created a new directory in
/var/www and then within that, symlinked
2006 Apr 07
2
MSSQL activerecord uses bad syntax
Hi all,
I''m trying to get rails up on mssql for a friend, does anyone have
experience? We''re working on a Windows XP box with MSSQL 2000 (no
service pak), and both rails (1.1) and MSSQL are on the same box. I''m
running into a bug (I think) where activerecord is using this syntax:
SELECT TOP 1 * FROM users WHERE (users.user = ''jbgnuumnbu'')
2006 Apr 17
6
Is there anyway to make Rails NOT cache?
Is there anyway to make Rails NOT cache? I''m getting caching in the
browser and the server.
I have to restart Lighttpd after every view change to see the results.
Thanks,
phill