#rubyonrails - Tue 27 Mar 2007 between 00:00 and 00:31

NY Lost Funds



testuser86i think i figured out how to do it, but it gets really complicated so screw it lol
ruxpinthis is a silly question but I have to ask .. how do I pass parameters to methods?
ToErrHey all
lonnyruxpin: Usually you don't... your view does. (Form elements in the view send params to the method called by the form.)
loftroffleok totally simple question, i tried using the docs to figure it out but I couldn't: I'm trying to find a user in the database from irb by name
dill = User.find(:name => 'dave')
gives me unknown key "name"
the code I'm learning from has this line:
ruxpinlonny: I'm just a newbie.. I'm thinking hard how can I get my sidebar to properly update the content div
loftroffleuser = User.find(params[:id]), but putting :name => 'dave' in for :id causes it to complain about :params
ruxpinlonny: the link on the sidebar should call a search method with some parameters, and the search method should produce 'yield' (if I understand correctly) for the content div. right?
loftroffleso basically, what is the syntax on .find for something like this? and where would I go to look this up?
pstickneapi.rubyonrails.com
manalanghi all... anyone know how I can get the dimensions of an SWF file using ruby?
pstickneloftroffle, find(id) find(:first, ...) find(:all, ...)
bongomanloftroffle: you can run the docs locally too by using 'gem_server' at the command line, then browse to 127.0.0.1:8808
pstickneloftroffle, the first will raise an exception if the PK with the given ID does not exist
loftrofflewow cool, thanks pstickne, bongoman :)
and yeah I was looking at the wrong documentation, no wonder it didn't make sense ^^;
uriah923can someone give me a quick summary of the difference between @user, user, and User?
tpopeUser is a class
it defines your model in general
user is a local variable
it is scoped to the method definition or whatever
def foo; user = User.find(1); end; <-- user disappears right after end
@user is an instance variable
in rails, you're probably assigning it in your controller and accessing it in your view
lriversI'm using the annotate_models plugin and it's confused about the inflection of something. It thinks that ProviderService should be tableized as provider_services. In reality it is providers_services. How do I express the correction in Environment.rb?
loftrofflewhat does @user do in just a plain old ruby [shell] script that user doesn't?
uriah923thanks, tpope
tpopeloftroffle, it's part of the object
it persists as long as the object does
you can assign it in one method and access it in another
loftroffleah, ok. whereas user is local to the given function
Lytolola
kinda quiet here
so what's everyone's opinion on favorite template engine... liquid?
diclophis-workhello all
Lytolhello
diclophis-workcan someone digg this site for me

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

IrcArchive

NY Lost Funds