AST on Rails

Hi All!

Following code is working perfectly on Ruby IDE, can anyone tell me how
will it works on Ruby on Rails. Because when i run it using ruby on
rails, it is not displaying anything and also no errors. Even I have
properly include rubygems and ruby_parser. Even Rails server stops
working

<%
require “rubygems”
require “ruby_parser”

sexpfaulty1 = RubyParser.new.parse(File.read(“faulty_0.rb”))

%>

<%= sexpfaulty1 %>

On Jun 11, 8:08 am, Michel J. [email protected]
wrote:

require “ruby_parser”

sexpfaulty1 = RubyParser.new.parse(File.read(“faulty_0.rb”))

%>

Why stick this in the view? Have you checked what the current
directory is when this executes

<%= sexpfaulty1 %>
You should escape this (with h) as if it contains invalid markup the
browser might get confused.

Fred

<%
require “rubygems”
require “ruby_parser”
ast = RubyParser.new.parse(File.read(“faulty_0.rb”))
print ast
%>
<%=h sexpfaulty1 %>

This code have the same previous problem. However, “print ast” showing
sexp(AST) in background, but not on the web browser. So definitly, there
is some escape problem. I tried “<%=h” but no effect yet.

/Michal

Frederick C. wrote:

On Jun 11, 8:08�am, Michel J. [email protected]
wrote:

require “ruby_parser”

sexpfaulty1 = RubyParser.new.parse(File.read(“faulty_0.rb”))

%>

Why stick this in the view? Have you checked what the current
directory is when this executes

<%= sexpfaulty1 %>
You should escape this (with h) as if it contains invalid markup the
browser might get confused.

Fred