Strange Error when Navigating the links

Hi,

I’m using MySQL database for my web application, and my main menu has 6
links towards the left of the page which connects to MySQL to display
the information.

I’m also having another link 7th which connects a different database DB2
it works fine, it fetches the records from the DB2 tables and displays
fine.

But now when i navigate to any of the first 6 links, i get this strange
error in the browser.

Showing app/views/my_operation/list.rhtml where line #4 raised:

compile error
./script/…/config/…/app/views/my_operation/list.rhtml:4: syntax error
_erbout.concat "

"

Extracted source (around line #4):

1:

List My
Operations


2:
3: <% if (@current_user.usertype_id == 1 || @current_user.usertype_id ==
3) %>
4:

<%= link_to ‘New My Operation’,
:action => ‘new’ %>


5: <% end %>
6:
7:

(In the list.rhml as we can see there are few spaces before the

.

If i remove these spaces the page is loaded fine. ie.

<%= link_to 'New My Operation', :action => 'new' %>

(As we can see i have removed the spaces in the start of that line)

This happens to all the lines which is NOT beginning in the start of
that line.

Also note that the above problem I’m seeing only if i first go to the
7th link and then from there navigate to the 1st link. (I’m not sure
if the use of multiple databases is causing this problem)

After starting the Web Rick (without going to 7th link) if i navigate in
between the first 6 links, I’m NOT getting the above error (Even if
Space is there or NOT), ie the same page loads even if space is there in
the start of the lines!!!

The development log displays the below message


ActionView::TemplateError (compile error
./script/…/config/…/app/views/my_operation/list.rhtml:4: syntax error
_erbout.concat "

"
^) on line #4 of
app/views/my_operation/list.rhtml:
1:

List My
Operations


2:
3: <% if (@current_user.usertype_id == 1 || @current_user.usertype_id ==
3) %>
4:

<%= link_to ‘New My Operation’,
:action => ‘new’ %>


5: <% end %>
6:
7:

Any idea why its happening, or any workaround or do i need to escape
characters to escape something ?

NOTE:- I want to do some indentation to the .rhtml files so i want to
leave some spaces.

Please let me know.

Thanks and Regards,
Dinesh

Hi,

Any idea of what i’m doing wrong here? and how i can escape the spaces
in the .RHTML file?

Many Thanks.
Dinesh

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs