Created
April 28, 2010 10:03
-
-
Save WaYdotNET/381955 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Kalifornium < Padrino::Application | |
register Loader | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Loader | |
def registered(app) | |
app.send(:include, Coder) | |
end | |
module Coder | |
def self.load_accessories | |
# variable | |
@sides = Side.all | |
@status = Status.all | |
@typologies = Typology.all | |
@toilette = Toilette.all | |
@beds = AdditionalBed.all | |
@children = Child.all | |
end | |
end | |
end | |
file in /lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view: | |
NoMethodError at /rooms/new | |
undefined method `each' for nil:NilClass | |
- @sides.each do |side| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kalifornium.controllers :rooms do | |
get :new do | |
Coder.load_accessories | |
@room = Room.new | |
@title = "ADMIN: Inserisci una nuova stanza" | |
render "rooms/new" | |
end | |
end |
DAddYE
commented
Apr 28, 2010
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment