#RubyOnRails - 19 March 2016
« Back 1 day Forward 1 day »
[00:08:07] Radar: siaw: You probably want to do allow(controller).to receive(:current_user).and_return(user)
[00:18:35] jstransky: Does anyone know if there’s a font-awesome gem that will allow me to use it’s mixins?
[00:19:39] martin290: Radar, would you think going from php to ror would be an easy move? I'm kind of sick of php
[00:21:16] Radar: martin290: PHP's syntax and general disregard for sensible programming practices is what makes it abhorrent to me.
[00:22:08] Radar: jstransky: Ah. You might be able to just do @extend .fa-check in that instance then?
[00:22:37] helpa: martin290: http://guides.rubyonrails.org/getting_started.html - Getting started with Ruby on Rails guide written by Mike Gunderloy and Ryan Bigg
[00:23:39] Radar: martin290: And if you want something more indepth than that, then I wrote a book too:
[00:23:40] helpa: martin290: Rails 4 in Action - http://manning.com/bigg2 - An excellent book combining Rails and TDD/BDD development. Written by Rebecca Skinner, Steve Klabnik, Ryan Bigg, Yehuda Katz
[00:23:43] rattatmatt: so, lets say I want to perform a post request from a controller to another server, using parameters coming from the user... what would be my best bet for that?
[00:24:14] siaW: Radar: where does the allow(controller).to receive(:current_user).and_return(user) go? in my controller spec?
[00:24:17] Radar: martin290: everything is an object and you call methods on objects to get where you want to get to.
[00:24:52] Radar: martin290: I have just been doing it for quite a long time: http://ryanbigg.com/about-me/
[00:25:20] Radar: And I've answered a lot of ruby / rails questions to cement that knowledge: http://stackoverflow.com/users/15245/ryan-bigg
[00:25:43] Radar: rattatmatt: If you're going to be posting files to that other endpoint, I would look at Excon though. HTTParty doesn't handle file uploads well.
[00:26:27] rattatmatt: Radar: no files, just params. there aren't any potential security issues with accepting params from the user and then just sticking them in, are there?
[00:26:38] siaW: Radar: does this make sense?https://gist.github.com/siaw23/e1ff201df46318b8258a#file-accounts_controller-rb-L10
[00:27:24] jstransky: Ok looks like font-awesome-sass will do what I want. How do I remove the old gem first?
[00:27:30] helpa: siaw: What "didn't work"? Did your server not start? Did your computer explode? Did your webpage turn bright pink? Did your client not pay your bill on time? You may have to be more specific. A Gist (http://gist.github.com) of the code that doesn't work (and the error you are getting) will be helpful.
[00:27:59] jstransky: Radar: Thanks, I thought so but wasn’t sure if there was a bundle uninstall or anything
[00:28:25] Radar: rattatmatt: Oh, right. You could use the excellent Stripe gem for that instead: https://rubygems.org/gems/stripe
[00:29:40] rattatmatt: Radar: oh, I'm already using the stripe gem, this is actually for custom oauth implementation with stripe connect
[00:30:20] siaW: Radar: if i use `allow(controller).to receive(:current_user).and_return(user)` the test doesn’t sign_in at all. i’m guessing it’s because it doesn’t know who `current_user` is
[00:30:22] rattatmatt: Radar: wouldn't be doing it if I didn't have to, but none of the oauth gems will do what I need them to do so I'm just going to do it myself
[00:31:02] Radar: rattatmatt: Did you try omniauth-stripe-connect? https://github.com/isaacsanders/omniauth-stripe-connect
[00:32:19] rattatmatt: Radar: yup, I can't remember which problem that ran up against but I think it might have had something to do with the fact that we're running as an api with token auth. can't remember though, I've been ripping my hair out for days trying various different gems/solutions
[00:33:01] Radar: siaw: What is this set_account filter? Filter chain halted as :set_account rendered or redirected
[00:33:59] rattatmatt: Radar: if I had the time to waste on it, I could probably make it work, but we need this within the next week so I gave up in favor of doing it myself
[00:34:08] siaW: Radar: https://gist.github.com/siaw23/677c38e271b02bdca3e1#file-accounts_controller-rb
[02:38:41] jottr: Why does c = Crowdbar.new c.fetch_stats c.save! not commit the fields to the db? https://gist.github.com/jottr/9206480467b87cdf75d5
[02:51:09] jottr: But, the attributes are not persisted: https://gist.github.com/jottr/9206480467b87cdf75d5#file-rails_console-rb
[02:56:59] SteenJobs: jottr: not really sure without being able to play with the code a bit more, but have you tried setting the properties explicitly and seeing if it changes anything? looking at the SQL being executed, its only inserting `created_at`, `updated_at’ values
[02:58:22] SteenJobs: jottr: did you try changing your model method to something like self.referal_count= instead of @referal_count=
[03:00:44] SteenJobs: aright, do me a favor and in console type c = Crowdbar.create!(total_commission: <some value>, referal_count: <some_value>, … seven_day_referal_count: <some value>) and let me know what happens
[03:09:13] jottr: SteenJobs: here's the schema.rb https://gist.github.com/jottr/af10de7deb5673b076b0
[03:15:28] SteenJobs: humor me and get rid of attr_accessor and then use the .create!() method as you did before
[03:19:08] SteenJobs: ActiveRecord creates its own getter and setter methods, and i believe attr_accessor overrides them and takes precedence
[03:19:25] SteenJobs: generally attr_accessor is used for virtual attributes that aren’t being persisted to the db
[05:15:12] pipework: You don't want to say hi to epochwolf, he may bite or rough up the legs of your armchair.
[05:16:10] hamster88: I have an article and a category model. which has many to many association with each other.. How can i view the article from just one Id?
[05:17:34] hamster88: let say I have a category named featured and I want to fetch all the articles with that id on home page..which is the action for the welcome controller
[05:27:59] Ropeney: you didn't post your schema, so i couldn't tell you how to get the correct instance
[05:33:40] hamster88: so all i need is to def @category in my welcome controller and then call it up ?
[05:34:55] Ropeney: @categories_first_article = Category.find_by(name: params[:category]).articles.first
[05:41:43] hamster88: ropeney, i tried > @categoryone = Category.find_by(name: params[:category]).articles.first
[05:49:26] Ropeney: okay, I dont know what your trying to do then. But you have a solution to the question you asked so you should be able to now make it work for the rest
[05:51:46] Ropeney: your ::easiest:: answer here is, @categories.each do |category| category.articles.first end
[06:00:52] pipework: @categories.includes(:articles).map(&:first_article) # Define #first_article as a scope like `scope :first_article, order('id asc').limit(1)` or so.
[06:03:08] pipework: The includes can go anywhere that you want to handle making sure the articles are joined in.
[06:06:37] hamster88: I am trying to display just the article from one category in one of the section on homepage
[06:07:28] pipework: hamster88: So you want to select an article for each category, besides belonging to the category, are there any other constraints?
[06:08:09] pipework: Perhaps choose and stick to one at least for the duration of us helping you. :)
[06:08:37] pipework: hamster88: @categories.includes(:articles) # This will have all the articles eagerly loaded for all categories.
[06:09:55] Ropeney: hamster88, look at comment https://gist.github.com/thedesignable/bac7068ec2ec643caff3
[06:14:29] Ropeney: i do, i just didn't care for it enough when i thought the point of the code was clear
[06:17:19] hamster88: only need to get the articles from featured category.. its fetching all articles
[07:06:55] alaing: I'm trying to build a plugin but having problem with the dummy app that gets created. I had added a development dependency that brings in some sass files in the dummy app's application.css.scss I reference it as '@import colours' but its ahving problems finding it
[07:07:47] alaing: I have another proper raisl app that uses the gem i'm depending on and I call it in exactly the same way and that has no problems finding it
[08:35:02] lxsameer: hey people, My app does not uses assets digest in production, but the digest option is set to true, where should I look for problem?
[08:44:28] zworks: when i tried to load it using the ruby CSV , it says ArgumentError: invalid byte sequence in UTF-8
[08:51:20] BinaryMaster: Question: is there a way to have a link_to without any text? for example <%= link_to about_path, class: 'fill-parent' %>
[09:07:39] jammanbo: Am using postgres. Can anyone tell me why this fails in a migration? `execute("SELECT * FROM actors WHERE name = ''")`
[09:08:10] jammanbo: => ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block
[09:13:53] jammanbo: ropeney: Hmm, no there is stuff earlier in the migration. Turns out that it works if I run it in a rails console. Hmm
[09:15:22] jammanbo: ropeney: Okay good hint, thanks. Yeah it is something to do with some other SQL being executed prior to that.
[10:14:31] siaW: SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 ORDER BY created_at DESC LIMIT 1
[10:39:09] Dreamer3: anyone else see really slow Rails::Rack::Logger#call times in New relic? trying to figure out what the deal is with Rails cache flushing these days
[10:43:09] hightower3: In a form with collection_select, how do I specify the default value that should be selected if no choice exists yet?
[11:15:55] hightower3: ropeney, thanks. (Right, I figured in the meantime that was the solution; I just thought there could be a default: or something)
[13:00:04] muhammadn: i hope to create an app with many users per company but the user will have a primary user controlling via the admin interface
[13:00:30] muhammadn: i have looked around (even with apartment gem) and basically it uses subdomains (from all that i have read on the internet)
[13:19:01] mwlang: scope: are you wanting to start the most bare-bones version of Rails possible and then add gems back as you go?
[13:21:12] durexlw: I guess if you're a bit new to the whole gems, google is your friend: "best authentication gem rails" will give you some references
[13:22:25] mwlang: if you click the individual categories, you can see what’s most popular within a category.
[13:22:27] scope: right so gems then are basically the core features that are used so often it makes sence to automate it
[13:22:36] durexlw: scope: it would be quite a work to list all advantages of a gem to make up your specific need I guess
[13:23:38] durexlw: scope: think of gems like a common coding task: like authentication: same views all over the place, or adding comments to your website. Stuff we all do individually, but that is (pretty much) general
[13:23:52] mwlang: scope: choosing gems is somewhat an exercise in efficiency once you’ve built a few rails apps. you get to know your gems real well after, say ten rails apps.
[13:24:43] durexlw: plus, you don't need that much gems... after a while you start to settle on a few
[13:25:29] mwlang: what I look for in gems is that they have been around a while, still have activity that indicates they’re being maintained and they have test suites covering their implementation.
[13:27:03] scope: i understand the dry stuff hence id have a navbar, footer, accounts, and ranking partial
[13:28:01] scope: so then really i should look at gems as little helpers. now heres where i get confused
[13:28:06] durexlw: i'd use haml, you should check that out... saves a lot of time in the html department of your site
[13:29:39] durexlw: scope: css is just css in rails as well... the only thing you can have is say you want to use a css framework, like bootstrap
[13:30:28] durexlw: then there will probably be a gem out there to strap that framework into your rails app, where the gem does most of the heavy lifting for you to have the framework in your rails app available (so takes away all the config and downloading stuff)
[13:31:01] durexlw: for example: look for "bootstrap gem rails" and you'll find a few gems that add the bootstrap-framework to your rails app
[13:31:43] durexlw: from there on, it's just bootstrap as in any other website, the only difference is that the files are arranged in the asset pipeline of rails, which is just a fancy way of saying that the css and js files are just organised in a structured folder
[13:33:30] durexlw: so if you want to use bootstrap in your rails app, you have two options: download bootstrap, upload to your rails app or use a cdn (just as you would do in any other site)... that works. Or you could just add "bootstrap-sass' to your gemfile and type 'bundle'... same thing
[13:34:21] durexlw: so the only thing you need to know is: in rails, where does html go, where does js go and where does css go... that's basically it
[13:35:12] durexlw: first of all: if you use gems: if the gem packs a new version of bootstrap, it will do that for you
[13:35:20] scope: some of the templates i have there is no indication in the bootstrap.css file to the version
[13:36:04] durexlw: scope: i'd just use the last version... they tend to be pretty slow in evolution anyway and fairly compatible among versions
[13:39:40] scope: reading the code to understand the version it was written in then selecting the appropriate version
[13:39:40] scope: im the type of person that wants to know why something is the way it is then how it is the way it is and then what i can make it do
[13:41:18] durexlw: the hardest part about rails for me was that it became 'a special thing' in my mind... whereas in fact, it's just html, css and js... the structure is a bit special, but in the end, it's just a convienient way to tie those things together. I know I'm over simlicying it, but I tended to overcomplicate it myself
[13:43:29] durexlw: Say I have a "Parties.yml" party1 has a title. I kinda thought that in my unit test, I could just do "@party = Party(:party1)" to retreive the data from the fixture. But that doesn't work. Can anyone say how to get the fixture data in my testfiles?
[13:48:09] durexlw: scope, I kinda think it would help you to look at this one tutorial... it shows how rails is actually build... it helps to demystify it
[13:52:02] scope: the way i describe rails to people is this: ruby is facebook rails is candy crush. while candy crush is a seperate entity it still needs facebook to run. but you can use facebook to maximise the users playing candy crush and to add some cool features t the game
[13:53:55] durexlw: ow lord... about the fixtures, could have looked for hours... it was just a typo
[13:55:45] durexlw: scope, about gems... here's a good advice: test using minitest or minitest spec... the whole rspec thing just overly complicates things imho
[14:00:59] scope: this is also the problem with alot of tutorials they use so many different gems but dont really say why
[14:04:12] Spami: So I made an API which is supposed to be though my website, is there a way to block users to directly hit my API without using my website?
[14:08:29] durexlw: so yeah, when files change, tests are run to see if changed don't break the tests... among other things. I can still live with that doing that myself
[14:10:47] durexlw: I'm no expert on the matter: but if you talk about preventing a user to... then you're into authentication. probably about 3 ways to do that: simple html auth, token based, oauth
[14:11:19] durexlw: Spami: so basically: pass some form of authentication into your api call and only respond when the user is allowed, authenticated to make that call
[14:13:13] durexlw: Spami: there is a difference between the users using your website (which can be accessible to all) and your website being authenticated, so allowed, to make an api call
[14:14:32] durexlw: basically look at your website as the only thing being allowed to use your api and all users of your website can therefore make api call through the website, but not directly (unless they have the login to your api)
[14:16:51] Spami: I don't want ppl to reverse engineer the JS on my website and start using the undocumented API
[14:21:22] durexlw: you have data, you did something to it to make it usefull. So I guess you either combined tables, added or removed columns or calculated fields... those latter actions, I refered to as 'transforming your data'
[14:24:15] durexlw: so do you first load your data in temp tables, then transform it into usable tables or how do you do it?
[14:27:11] Spami: durexlw, basically, my data come from public records, the government gives me datasheets that I load in temp tables. Then I try to find the most common parts with each tables
[14:27:46] Spami: I create a final table. Then I organize each temp table so it fits the final one and then I load everything into the final table
[14:28:29] Spami: it's a pain in the ass because there are a lot of typos, and from year to year the spreadsheets have different field. Usually the newest have some very valuable nformations
[14:29:07] durexlw: Spami: I hear ya... I used Kiba for that same purpose. It's a cool concept in that you can use ruby to process the information and you're therefore not restricted to sql
[14:30:32] durexlw: Spami: I hope so too... the thing I did was for government as well... they have a way of fucking up data
[14:34:22] durexlw: well good luck man. I hope it works. I'm having the same battle with a few companies.
[14:35:12] durexlw: we're doing a universal reporting system, but getting access to the data can mostly today only be done by exporting a few reports and then importing it... I want a direct link
[14:47:32] neohunter: I want to create a column to store the transmission type of my, lets say, "car", what would be the best column type for this? enum('automatic', 'manual') or a boolean?
[15:47:39] durexlw: neohunter: from db normalization point of view, you'd make a transition_types table
[15:48:57] neohunter: @durexlw what! but is only 2 options that will never change, that's is inpracticall, would I need to create a table even for gender?
[15:49:28] pipework: neohunter: In todays' social climate, gender is not always perceived as binary.
[15:50:10] pipework: Though I also don't really personally find use for a table either, just store a string and have the input field show male, female, prefer not to answer, and allow text input.
[15:52:55] pipework: neohunter: For things like you mentioned, the question might be better approached by asking whether you want to query based on the transmission type.
[16:00:18] durexlw: neohunter: as pipe says... if it's that simple and needs no configuration, take string and hardcode the choices in your app
[16:46:01] mices: i can't use commas in a text field in my form, active record returns an invalid sql syntax error
[16:48:05] Technodrome: for a dashboard style application, what would you make the controller for the actual dashboard landing page? like DashboardController?
[16:51:00] pipework: For your own convenience, feel free to name the controller however you like though.
[16:51:03] Technodrome: im guessing many would just check for a login and use the dashboard controller
[16:52:36] Technodrome: just a poll beingjohnm , but how many controllers do you have that are not model backed?
[16:53:11] pipework: It's a healthy mindset to disjoint models with controllers in terms of association or assignment. 1:1 ain't a thing to ever concern yourself with.
[16:54:01] beingjohnm: Technodrome: what pipework said. But it looks like four or five on this application.
[16:54:18] pipework: Actions are HTTP entrypoints with middleware. Rails routes requests to actions. Within the action, you have your whole application to do things with the request if you should choose.
[16:54:20] beingjohnm: Where I always run into problems is with models that aren't active record backed :)
[16:54:34] Technodrome: besides dashboard , what are the other controllers doing? static page controller?
[16:55:30] beingjohnm: pipework: I've found a lot of work arounds but it is kind of annoying that you use a lot of functionality when you aren't extending active record base. But thanks for the offer!
[16:55:52] Technodrome: also if you don't mind me asking, what kind of application is it beingjohnm ?
[16:57:52] Technodrome: is the reports controller just aggregating data from all the other controllers ?
[16:58:56] beingjohnm: pipework: I can't recall but I think there was the issue with active model was I couldn't do user.transactions.find() or whatever. So I worked aroudn that by setting the user in a method and then extending it. But honestly cannot remember why I couldn't get ActiveModel to work.
[16:59:45] beingjohnm: Technodrome: reports controllers displays the reports. and the reports do gather data from various models.
[17:00:07] durexlw: but you still use models to populate your data in your dashboard and in the dashboard controller, you filter those models, right?
[17:00:52] Technodrome: durexlw of course yeah, the app has tons of models, the dashboard is just a hub in a sense with no particular data needed in that context specifically for that resource
[17:05:04] Technodrome: well i guess in a way its just a static controller in a gem with some helper functions, but just gets it out of the app folder
[17:06:25] durexlw: Can someone tell me what I'm doing wrong? I'm trying to give a has_and_belongs_to_many another name as the model name: https://gist.github.com/durexlw/cb8fb179bc2dc1ffb26a
[17:22:37] beingjohnm: mices: I have to step away in a momemnt but can you update that with the error messages you are receiving? Include the query.
[17:29:34] beingjohnm: mices: you might want to check your column character sets as durexlw alluded to
[17:29:57] beingjohnm: I have never had an issue like this before so I'm not sure if I will be a lot of help.
[17:46:23] rattatmatt: how can I force the client to redirect to a different website in my rails api? so they hit an api endpoint and instead of returning data to the client, I want to redirect them to an html website (meaning not redirecting to another api endpoint)
[18:16:14] FCser: So I've added a new has_and_belongs_to_many association between some existing models. The migrations have been setup. Fields added to the view. Now do I have to manually create the association records in the create / update actions?
[18:28:24] Technodrome: but its sorta working for my purpose, editing around 15 pages of static content
[18:29:20] pipework: Technodrome: The biggest pain is that you're using something that works whale when not customized to hell for a situation where 110% of the time people want to be able to customize to hell.
[18:30:22] Technodrome: i hate splitting it up when doing a project in rails, and then doing front end in drupal
[18:31:58] Technodrome: yeah using the CMS for config , and moving things around with blocks and regions, thats not exactly the intention when I mean CMS like this with rails admin
[19:02:42] Technodrome: seems like the closest thing to work, but in reality its doing a very similar thing to rails admin
[19:05:12] Technodrome: refinery has a very light region control system, and a tree view for management of pages
[19:20:35] Technodrome: hnanon http://stackoverflow.com/questions/2168442/many-to-many-relationship-with-the-same-model-in-rails
[19:23:46] durexlw: hnanon: you may want to sore which kind of relationship the one city has to the other
[19:26:23] durexlw: to be more specifix: I have Parties (which can be a company or a person). A party can have a relationship to another party. For example: Marc (a party of type person) can have a relationship with "Company inc." (a party of type company). The kind of relationship is important
[19:27:28] durexlw: in the same way: a city is related to another city... it could be that the kind of relationship is relevant to you
[19:30:04] hnanon: Well, in my case, a city has it's own show view. That view links to "connected cities" (just nearby cities).
[19:30:52] durexlw: hnanon: fair enough... then the sole fact they are physically close is enough... sounds like no more info is needed then
[19:31:49] durexlw: arup_r: self join indeed... but the join table needs extra info, which makes it a bit more complex
[19:38:56] Technodrome: i've not done it in rails, but i have done it in django many times, i assume its the same as that link shows, is there a part of it you dont' understand?
[19:40:12] Technodrome: hnanon http://stackoverflow.com/questions/5109893/rails-how-do-self-referential-has-many-models-work this can help too
[19:40:54] Technodrome: hmm in a weird way, maybe depending on how you are doing it, a tree could work as well hnanon
[19:41:07] Technodrome: why are cities relating to other cities? what is the explaination behind it?
[20:56:39] Technodrome: so creating some sort of related city database for that i think, may not be the best idea
[20:57:01] Technodrome: you would have so many overlapping records for each city, it would be huge even for a small country
[20:58:22] Technodrome: there is alot of articles about distance and geolocation in rails, there is no way you woulld want to create a self referential model that keeps relating close by cities
[20:58:22] hnanon: The geolocation database will find the 10 largest cities within x miles and show them?
[20:59:09] Technodrome: so 500 records just just 5 cities which are close, right? i think my math is correct here
[20:59:32] Technodrome: because each city will have 5 records of the close cities (assuming there is only 5 close cities()
[21:00:04] Technodrome: you are essentially making each city a tree, a parent, and having child cities as a child, and then those children could have, and there would just be so much overlap
[21:00:34] Technodrome: a geolocation database would be better, there is many for rails, and you can have it all run locally, you dont need to use a 3rd party REST api
[21:01:10] Technodrome: if it was geographically restricted to one very small area, and there was good reason, like say you wanted to relate all the neighborhoods in San Fran , then maybe
[21:01:24] Technodrome: because that might not be so accurate with geolocation, usually its just cities
[21:20:28] Technodrome: now if you had a database of every US city with a field for population, that wouldn't be so bad
[21:20:45] Technodrome: but creating that self referencing tree structure overlapping, oh boy that would be a huge huge headache
[21:47:08] durexlw: synaps3: where are you at the tutorial? up till where did it work and when did it start to go wrong?
[21:47:36] beingjohnm: makerops: woah. I believe I remember you from a couple other channels but haven't seen you here.
[21:51:05] durexlw: can you add the line back in, make a gist of that file and mark the line that gives the error?
[21:52:54] durexlw: heavy competition though... hard to compete the countreis that work at $10 or less. I don't mean this offensive in any way, just as an observation that fees tend to be different among countries
[21:53:45] makerops: georgedrummond, i have an IFTTT recipe setup to scan craigslist for some local major cities
[21:55:01] georgedrummond: haha awesome. maybe i can get my hue lights to flash if any leads come up
[21:55:10] hnanon: Does the geocoder gem all me to pass a city object and retrieve an array of nearby cities?
[21:57:08] durexlw: hnanon: I think you need to think about: do you mean with 'near', closeby or neighboring?
[21:59:03] alaing: I'm trying to build a plugin but having problem with the dummy app that gets created. I had added a development dependency that brings in some sass files in the dummy app's application.css.scss I reference it as '@import colours' but its ahving problems finding it
[21:59:36] alaing: I'm trying to build a plugin but having problem with the dummy app that gets created. I had added a development dependency that brings in some sass files in the dummy app's application.css.scss I reference it as '@import colours' but its ahving problems finding it
[22:00:03] alaing: I have another proper raisl app that uses the gem i'm depending on and I call it in exactly the same way and that has no problems finding it
[22:00:05] hnanon: However, I was hoping there was a way to get all cities (from whatever api its using) that are near a given city (instead of those cities needing to exist in my cities table).
[22:00:24] synaps3: durexlw: thanks for your help but i have to go now will be here tomorow trying to fix this, bye
[22:38:15] Technodrome: this rails app I have to support has 1 page controller, and 300 methods, and then 300 lines in the routes for the url's , i know this is common in smaller sizes, but jeesh
[22:58:12] Technodrome: sometimes its they plan to do 10 pages or 15 , then it gets to a 100 and so on
[23:03:04] smathy: Technodrome, heh, you say that as if a controller writes its own methods while you sleep ;)