Topic: how do I diplay values from a hash ?

VIEW

    <% foof = DiaryController.new  %>
    <%= inst_section[:oboe] %>

OR
    <%= foof inst_section[:oboe] %>


CONTROLLER

def foof
  inst_section = {
  :cello => 'string',
  :clarinet => 'woodwind',
  :drum => 'percussion',
  :oboe => 'woodwind',
  :trumpet => 'brass',
  :violin => 'string'
  }
 
end


I swear I am reading the tutorials and books but these are things it does not tell me
There is a major lacking documentaion of ERB I know it's just ruby but things that work in irb just don't show in ERB for me yet

Re: how do I diplay values from a hash ?

Try using @instance_variables instead variables.
By the way I still have to think before using variables, @instance_variables and/or :symbols. Like in one my case I can use variables in view and I still don't know why it's working without defining it first in controller.. (http://railsforum.com/viewtopic.php?id=390)

controller

def foof
   @inst_section = { :cello => 'string', :clarinet => 'woodwind', :drum => 'percussion', :oboe => 'woodwind', :trumpet => 'brass', :violin => 'string' }
end

view

<%= @inst_section[:oboe] %>

Estonian ruby coders => http://ruby.ee