Scriplets are not working

Newbie to Ruby, working on examples Agile Development with Rails2.

  • Addition: <%= 1+2 %>
  • Concatenation: <%= "cow" + "boy" %>
  • 1.hour.from_now
  • Time in one hour: <%= 1.hour.from_now %>
  • this code simplly prints like this

    Addition:
    Concatenation: 1.hour.from_now
    Time in one hour:

    dynamic code is not displayed. I don’t understand what was the problem.

    I restarted the server for serverl times, but no use.

    Please help

I just ran your code snip and it worked fine for me. What is the name
of
the your view?

On Wed, May 7, 2008 at 10:38 AM, Vijay R. <
[email protected]> wrote:

Addition:


James M.

James,

name of my view is hello.rhtml.

James M. wrote:

I just ran your code snip and it worked fine for me. What is the name
of
the your view?

On Wed, May 7, 2008 at 10:38 AM, Vijay R. <
[email protected]> wrote:

Addition:


James M.

Please paste your code exactly how you have it.

I’m thinking the 1st and 3rd don’t have the = with them.

On Thu, May 8, 2008 at 3:47 PM, Vijay R. <
[email protected]> wrote:

Any one got this problem ?


Posted via http://www.ruby-forum.com/.


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.

Any one got this problem ?

Hi Ryan,

Below is the code:

  • Addition: <%= 1+2 %>
  • Concatenation: <%= "cow" + "boy" %>
  • Time in one hour: <%= 1.hour.from_now %>
  • and the out put is simply puts the static content.

    . Addition:
    . Concatenation:
    . Time in one hour:

    Regards,
    Vijay

    Before you said the second one worked, and now you said it hasn’t.

    Which is it?

    Hi Ryan,

    My hello.rhtml code is like this.

  • Addition: <%= 1+2 %>
  • Concatenation: <%= "cow" + "boy" %>
  • Time in one hour: <%= 1.hour.from_now %>
  • and the controller class is say_controller.rb

    class SayController < ApplicationController
    def hello
    end
    end

    and if i try to execute the code in using this URL

    http://localhost:3000/say/hello

    the output of the code is

    Addition:
    Concatenation: 1.hour.from_now
    Time in one hour:

    Why it is not executing the scriptlet code.

    -Vijay

    On May 8, 2008, at 12:58 AM, Vijay R. wrote:

    the output of the code is

    Addition:
    Concatenation: 1.hour.from_now
    Time in one hour:

    Why it is not executing the scriptlet code.

    Also, do a “view source” in the browser and paste that.

    On May 8, 2008, at 12:58 AM, Vijay R. wrote:

    Addition:
    Concatenation: 1.hour.from_now
    Time in one hour:

    Why it is not executing the scriptlet code.

    -Vijay

    Vijay,
    It looks like you are typing things in the email. You should copy and
    paste everything, because you are making transcription errors in
    preparing the emails.

    Hi George B.,

    Here is my view source code from IE 6.0

    • Addition: <%= 1+2 %>
    • Concatenation: <%= "cow" + "boy" %>
    • 1.hour.from_now
    • Time in one hour: <%= 1.hour.from_now %>
    • -Vijay.

    Hi George B.,

    Sorry i did not get what are you saying? Can you briefly tell what was
    my mistake, Just started Rails so kindly answer my stupid questions.

    Thanks in advance,
    Vijay.

    Sumesh,

    Tried with the below code

    Addition: <%= 1+2 %>
    Concatenation: <%= “cow” + “boy” %>
    Time in one hour: <%= 1.hour.from_now %>

    output is

    Addition: Concatenation: Time in one hour:

    Vijay.

    Hello,

    try with out

  • tag

    regards
    sumesh

  • All,

    Anyone having the similar issue.

    Vijay

    it’s working now, i have just created another view, it’s working fine.

    Thanks one and all…

    I WAS ABLE TO SEE THE VIEW SOUCE COD AS

    Addition: <%= 1+2 %>
    Concatenation: <%= “cow” + “boy” %>
    Time in one hour: <%= 1.hour.from_now %>

    BUT THE output is

    Addition: Concatenation: Time in one hour:

    Any one got this kind of issue.

    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