I have a menu controller that has the configuration for the menus in
my web. Each action is a menu and I have a function "opcion" that
creates options that are stored in an array @opciones this way:
[{:nombre => "name",:controller => "controller",
:action=>
"action"}...] This array is later used in the view to create link_to
items.
In this code I have the menu "secciones" with three options:
  def secciones
    @opciones = Array.new
    @opciones <<
opcion("LifeSTech","lst","index")
    @opciones <<
opcion("Investigacion","investigacion","index")
    @opciones <<
opcion("Publicaciones","publicacion","index")
  end
  private
  def opcion(nombre,controller,action)
    return {:nombre => nombre, :controller => controller, :action=>
action}
  end
In the view "secciones.rhtml" I have:
<% @opciones.each do |opcion| %>
        <%= link_to opcion[:nombre], {:controller =>
opcion[:controller],:action => opcion[:action]}, :class =>
"enlaces_contenidos"%>
<% end %>
This works perfectly if I have no accents, but if I use
"Investigacion" instead of "Investigación" it gives me this
error:
./script/../config/../app/controllers/menu_controller.rb:7: syntax
error, unexpected tIDENTIFIER, expecting '')''
    @opciones <<
opcion("Investigación","investigacion"_->parsererror<-
_,"index")
_->parsererror<-_ marks the point where the parser crashes
The file is ANSI but I''ve tried with UTF-8 and I have not solved the
question. I think the problem is specific to rails 1.2.* because this
code works with accents in 1.1 with this code in the application.rb:
  after_filter :set_charset
  def set_charset
    headers["Content-Type"] ||= "text/html;
charset=iso-8859-1"
  end
This code does not work anymore with rails 1.2.
I would appreciate any help.
Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---