Displaying 16 results from an estimated 16 matches for "seancolquhoun".
2006 Jun 01
4
How do I get today''s date?
I know this is a simple question, but i just want to put the current
day, month, date and year on my website. I still can''t figure out how to
read the Rails API. Can anybody help me out? TIA
--
Posted via http://www.ruby-forum.com/.
2006 Apr 06
2
making an integer from a float
Does anybody know how to turn a floating-point number (i.e. 60.345) into
an integer by cutting off or rounding the decimal portion? Either
method, or both, would be quite welcome. Thanks! This forum rocks!
--
Posted via http://www.ruby-forum.com/.
2006 Jul 05
3
splitting a story with double-spaced para''s
Quick question - if i want to separate a long string of text, separated
by single carriage returns, into an array of paragraphs, I can use the
following code:
paragraphs = article.content.split("\n")
The "\n" means a carriage return, as far as I can tell.
If I wanted to take text, that had been written using the more common
double carriage returns, into an array of
2006 May 12
8
switching from development to production?
I think I''m missing a step here, but they don''t seem to cover this in
the AWDWR book... does anybody know the various steps required to switch
from development to production mode in Rails? I''ve scoured the
application and changed everything that stands out, but the damn thing
is still running off the development database and won''t connect to the
production
2006 Mar 30
7
text_area
How to make that the typed code on ruby in text_area it was carried out
in @params ["name"]??
--
Posted via http://www.ruby-forum.com/.
2006 Jul 05
2
splitting a paragraph into words and spaces
I''m using this:
<% words = article.content.split(/ /) %>
<%= words[0..20] %>
to (ostensibly) split a paragraph into component words, with spaces in
between, then print to html only the first 20 items, words and spaces. I
got this (split(/ /)) from the online pickaxe book at
http://rubycentral.com/book/ref_c_string.html#String.split . The problem
is, the resulting array
2006 Jun 08
1
built-in dropdown jumps?
Hey everybody! I was just wondering if Rails'' javascript library
includes something as simple as making a dropdown that jumps to the link
when selected without needing a "submit" button. I see a bunch of AJAX
effects and draggable-element stuff, but all i need is a simple
dropdown... should I code it myself?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 03
15
How should I pick a random entry from the database?
Hi guys. Total newbie here. I''ve been doing web stuff since 1996 but
only began the foray into scripting last year. I haven''t got my skull
completely 360 degrees around OOP yet. It''s just me here (in Japan) and
there are no Ruby groups in my area (never mind any in English).
I''ve got a database table - real simple: question, answer, and id fields
- and I
2006 May 17
5
Today is "Rails Hates Me Day"
Has anybody had Rails just refuse to cooperate with anything?
I had an application working great in development mode, then switched it
over to production, tried to host it, but couldn''t. Some error that I
can''t figure out. So I decided to create a simpler application, host
THAT in little baby steps until something went wrong so I could tell
maybe where I was losing it.
2006 Jun 06
8
How do I wrap a <%= link to %> around an image?
I''ve got a bunch of dynamically generated link paths that I want to use
to link some dynamically-generated image paths. Specifically, I want to
link thumbnails in a gallery to the larger images.
But I''m stymied by Rails'' syntax. I can''t figure out how to do this.
I tried this:
<%= link_to(image_tag("../../images/photos/photo.photogroup/TN_
2006 Apr 07
22
Find WHERE in Rails
I''d like to find all records that have a certain integer as their
"level" field in the database. I know how to find all the records:
allquestions = Question.find(:all)
...and I know how to find the one record that has a certain id:
allquestions = Question.find(params[:id])
...but how do you find all the records that share a certain value in one
of their fields? I tried
2006 May 15
0
Rails - Apache - Japanese text: ????
Is anybody aware of any special issues Rails has with Japanese/Chinese
characters?
My database is peachy, the application works fine on my local machine
when I run it off of WEBrick, but for some reason when I host it
(Dreamhost) all of the Japanese characters come up "????". I''ve run
killall like five times to restart the server too, so all I can come up
with is that
2006 Apr 05
1
FormTagHelper form names: possible?
Thank you to everybody that has helped me since I signed up. I''m flying
along thanks to you.
I have a question about the FormTagHelper "start_form_tag": I''ve been
trying to figure out how to get Rails to output a "name" attribute for
my form so I can hook in a Javascript to focus on a field inside of it
on load, but it doesn''t look like I can do
2006 Apr 05
0
RoR groups/classes in Osaka
Does anybody know any RoR groups or classes in Japan? Especially the
Kansai area? I would have thought the place would be crawling with them,
but I can''t find any. The language is no problem; I can ????
--
Posted via http://www.ruby-forum.com/.
2006 Apr 06
0
Class definition OK?
Something''s not working, and I just want to make sure that my class is
not to blame and that I''ve got how it works straight in my head:
The attr_reader parts make those :something (hash values, i think)
accessible as @class.something attributes outside of the class. So, once
I find the right session in the controller, I can access those values as
@session.something. Right?
2006 May 31
3
Database can''t connect -
I''m sorry guys. I''m really still such a newbie at this. i''ve been having
trouble getting my Rails apps to run on Dreamhost, and I think it might
be a problem with the database connection. Anyway, I read on Code
Snippets that I should do this:
[rhod]$ ruby -Iconfig -renvironment -e "p ActiveRecord::Base.connection"
to find out if my database.yml file is