| shruggar | instance variable? |
| baggend | shruggar: Just make it an instance variable and access it from wherever you want. |
| dionysian | baggend: doesn't render_action take a symbol? |
| shruggar | well,, it's more like a macro I want access to in all views, but is very view-specific (ie: not controllery at all) but is too short to warrant a partial |
| davean | baggend: it is generating "UPDATE progresses SET "sequence_id" = NULL, "done" = NULL, "student_id" = NULL, "state" = NULL, "updated_at" = '2007-02-28 22:23:53.644164' WHERE id = 1" |
| baggend | dionysian: It can take either. The render is obviously working because I'm getting a page back. davean: Well, I'd say that's the problem then. :) (I'm master of stating the obvious. :) ) |
| davean | baggend: But why? :( Infact, every statement sets them to null, they are never set correctly |
| baggend | davean: Did you override your .create! to automatically give it some default values, or are you leaving all the other values as NULL? |
| dionysian | baggend: where are you calling list? |
| davean | baggend: I have not overrided create! overriden |
| dionysian | baggend: (more for my education than to offer help) i'm a tol noob |
| baggend | dionysian: list or list_unvalidated? list just gets called from the URL. list_unvalidated gets called by a link_to using :action => 'list_unvalidated' davean: This is pure speculation, but it might be because none of the other values are set? Try setting all of the values to something other than NULL and see if that works. Erm, davean rather (tab completion strikes again) |
| dionysian | @ refers to an instance variable, right? |
| theRemix | when i copy everything to production server, is the only thing i have to change, the environment variable? from development to production? |
| davean | baggend: some of the others now get set in save, done does not |
| baggend | shruggar: Sorry, just now saw your other message. If you primarily want to use it in views put it in a helper. |
| davean | baggend: also, what is the proper way to set default values? baggend: I see before_create |
| baggend | davean: I just had an idea! Try using .new instead of .create! |
| davean | baggend: nope, done still not saved, set to null |
| baggend | davean: The proper way AFAIK is to pass them in as arguments. So something.create(:somecolumn => "my deafult", :othercolumn => 12, etc dionysian: Yup, @ is for instance variables. @@ is for class variables. |
| davean | baggend: no, generic defaults you don't want to specify each time, like say, assiging an empty hash |
| dionysian | baggend: wouldn't you want <% @header = "Sites" %> |
| baggend | baggend: What I would do in that case would be to override .new and set your defaults in there. Then just use .new instead of .create. I usually only use .create when I'm passing the values in right away. (Like importing data during a migration for example.) |
| MrHeavy | Is there a method in Rails that returns the filename to be loaded given a name of a partial? |
| baggend | davean: Oh, look, I'm talking to myself... that was supposed to be for you. :) |
| davean | heh |
| dionysian | er <% @heading = "Sites" %> |
| baggend | dionysian: Well, yes, but that's why I have heading=() overriden in the helper, so that I can determine which value @heading actually keeps |
| theRemix | is there anything in config that i should modify before copying everything to production server? |