So I wrote this in my controller on a RoR app.
class KalendarController < ApplicationController
def show
@week =
if Date.today.cweek % 2 == 0
puts "E"
else
puts "O"
end
end
end
the @week variable should hold "E" or "N" depending on the result of Date.today.cweek % 2 == 0 so that I can display the letter "N" or "P" in the View
which looks something like this:
<h1>Kalendar#show</h1>
<p>Find me in app/views/kalendar/show.html.erb</p>
<p><%= @week %>
But this is not working. Can someone please point out what I'm doing wrong?