On 22 February 2010 13:41, Guille San <[email protected]> wrote:
> Hi everybody
> I´m trying to do a partial refresh, I use the div tag, but it doesn´t
> work and I don´t know where I have done an error if someone can help me
> I will be very gratefully THANKS!! Here is my view
> <head>
> <%= javascript_include_tag “prototype” %>
> </head>
> <h1>Listing comments</h1>
>
> <table>
>  <tr>
>    <th>Title</th>
>    <th>Body</th>
>  </tr>
>
> <% @comments.each do |comment| %>
>  <tr>
>    <td><%=h comment.title %></td>
>    <td><div id=”comment_<%= comment.id.to_s %>”>
> <%= link_to_remote( “Show Body”,
> :update => “comment_#{comment.id.to_s}”,
> :url => { :action => :show_body,
> :id => comment }) %>
> </div></td>
>
>    <td><%= link_to 'Show', comment %></td>
>    <td><%= link_to 'Edit', edit_comment_path(comment) %></td>
>    <td><%= link_to 'Destroy', comment, :confirm => 'Are you sure?',
> :method => :delete %></td>
>  </tr>
> <% end %>
> </table>
>
> <br />
>
>
>
> <%= link_to 'New comment', new_comment_path %>
>
>
> and here is the problems report
>  SyntaxError in Comments#index
>
> Showing app/views/comments/index.html.erb where line #2 raised:
>
> compile error
> C:/Instant/rails_apps/discussion/app/views/comments/index.html.erb:2:
> Invalid char `\223' in expression
> C:/Instant/rails_apps/discussion/app/views/comments/index.html.erb:2:
> Invalid char `\224' in expression
> C:/Instant/rails_apps/discussion/app/views/comments/index.html.erb:16:
> Invalid char `\223' in expression
> C:/Instant/rails_apps/discussion/app/views/comments/index.html.erb:16:
> Invalid char `\224' in expression
> C:/Instant/rails_apps/discussion/app/views/comments/index.html.erb:17:
> Invalid char `\223' in expression
> C:/Instant/rails_apps/discussion/app/views/comments/index.html.erb:18:
> syntax error, unexpected tSYMBEG, expecting ')'
> :url => { :action => :show_body,
>  ^
> C:/Instant/rails_apps/discussion/app/views/comments/index.html.erb:19:
> syntax error, unexpected ')', expecting kEND
> :id => comment }) ).to_s); @output_buffer.concat "\n"
>                         ^
>
> Extracted source (around line #2):
>
> 1: <head>
> 2: <%= javascript_include_tag �prototype� %>
> 3: </head>
> 4: <h1>Listing comments</h1>
> 5:

Always look at the first error message first, which says invalid
character in line 2.  I think if you look carefully you will see that
the double quotes are not what they appear, possibly the line was
copied and pasted from a word document.  Replace them with real single
or double quotes.

Colin

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to