Automatic .santize?

Hello and thanks in advance to those who post back,

I’m working on a calender but, it renders the data in the controller
then saves it as @code so I call it in the veiw <%= @code %>. So
everythings working and I add this line…
@event =
if @event == nil
@@td = “

#{@temp13.to_s[0,3]} |

@@ntd = “#{@temp13.to_s[0,3]}
| #{}

@@td = “#{@temp13.to_s[0,3]} | #{}
link_to @event.title, :action => :show_date, :id =>

@@ntd = “#{@temp13.to_s[0,3]}
| #{}
<%= link_to @event.title, :action => :show_date, :id
=> %>

now when I run it on the days with events it shows <%= link_to
@event.title, :action => :show_date, :id => %> why dosn’t it
run the code? Is there a way around this or do I need to move my code in
to my templete?

On May 31, 2006, at 1:06 PM, Programmer wrote:

| #{}
<%= link_to @event.title, :action
Posted via

Rails mailing list
[email protected]

You need to move that code into the view file where it belongs. Doing
it in your controller like that will not evaluiate the erb template
statements so you get the results you are currently seeing. Also I am
wondering why you are using class variables here @@ ? THey will cause
you problems so you shouldn’t use them unless you have a very good
reason to do so.

You could also use much better and more descriptive variable names.

temp1 temp2 are horrible names for vars. ALso there is a calendar
helper already available that might save you a ton of work here: