fullname = Iconv.iconv(“ISO-8859-1”, “UTF-8”, fullname)
now on the view page I try to access that hash.
<% ldaphash.each_pair do {key,val} %>
<%= “#{key} => #{val}” %>
<% end %>
Since I am total noob with these hashes on ruby any ideas ?
If you want something in your controller to magically appear in your
views you need to be using instance variables (ie @ldaphash). And the
last bit should of course be
<% ldaphash.each_pair do |key,val| %>
<%= “#{key} => #{val}” %>
<% end %>
undefined local variable or method `ldaphash’ for #<ActionView::Base:
0xb76bd0c0>
It’s still an instance variable in the view, so it needs to be @ldaphash.each_pair
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.