#rubyonrails - Sat 31 Mar 2007 between 01:31 and 01:44

NY Lost Funds



eakbasthen, save method of the model, who actually executes the sql, how does it know that there is a new column?
sorry about asking silly questions (if they are), i just started learning rails
thinfueakbas: the model knows all the columns it has, YourModel < ActiveRecord::Base i.e. it inherits from that class and that class happens to dynamically figure out all that stuff for you
t0rneakbas: no apologies necessary ... i'm new too, for the most part :)
eakbasohhh, ok. it makes sense now
thinfueakbas: there's a lot of magic happening in the background
t0rnyeah ... a crapload of voodoo haha
Palishdamnit
migrations need to be transactions
soo..anyone know how to roll back to the previous migration versoin?
thinfuPalish: you can wrap migration in trasactions if necessary
t0rnrake db:migrate VERSION=# where # is the version of migration you want to move ot
to
that is a destructive process though keep in mind
Nathan1_Is there a way to make symbolic links on the server without SSH access?
thinfuNathan1_: make a bash script ;)
cygnus128Nathan_: if you have some kind of ability to run commands i'm sure you could hack something together
thinfuand run it from the web.. i dunno ;P
cygnus128if you have the ability to schedule cron jobs or write some ruby code that runs an exec() or something
Radnirea silly little question, if I have a links_to link, how do i use both a variable and text for the link text? for example I want the link text to contain the contents of @number followed by ' post have been made.'
and sorry about the 'back to basics' of my question :)
cygnus128am i the only one to whom the fact that the default table name for a model class called Admin::User is just 'users'
Nathan1_So, it's easiest just to have SSH, I can't just write up a quick redirect file and upload it?
tpopeRadnire, just use string interpolation
in fact, for that, you want the pluralize helper
Radnirelink to an example?
tpopelink_to(pluralize(@number,'post') + " made",...)
Radnireahh thanks pal :)
thinfuRadnire: @number.to_s + ' post have been made.' or "#{@number} post have been made."
pluralize is better tho heh
tpopepluralize won't fix have/has
actually
pluralize(@number,"post has","posts have")+" been made"
Radnirehow about just for 'x Comment/Comments' where x is a digit
tpopepluralize(x,"Comment")
cygnus128oops, that should have read "am i the only one to whom the fact that the default table name for a model class called Admin::User is just 'users' seems wrong"
tpopepluralize takes care of the rest
Radnireim definately buying me the AWDWR book tonight
cygnus128it is a fine book
tpopenobody uses nested controllers

Page: 2 9 16 23 30 37 44 51 58 65 72 79 

IrcArchive

NY Lost Funds