html - Ruby on Rails localization -


i have localize web site using yml files. i'm having problems following:

<tr>     <td><%= link_to author.name, :action => 'show', :id => author %></td>     <td><%= link_to 'edit', :action => 'edit', :id => author %></td>     <td>         <%= button_to t(:delete), {:action => 'destroy', :id => author},         {:method => :delete,         :confirm => "are sure want delete author #{author.name}?"} %>         :confirm => t(:sure_delete_author, :authorname=>#{author.name}) } %>     </td> </tr> 

t(:delete) works should, confirm doesn't. left original , not working one.

the problem trying use string interpolation when there no string (which seems simple copy-and-paste problem)

instead of

:authorname => #{author.name} 

try 1 of these:

:authorname => "#{author.name}" :authorname => author.name 

the last 1 of course preferred :)

ps: in personal experience using new ruby 1.9 hash syntax removes lot of visual clutter , makes spotting problems lot easier.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -