vendredi 27 mai 2016

Controller in helper_method not showing views Ruby on Rails

I'm new in Ruby on Rails and web programming. I have this code view new.html.erb

<h1>EVALUATING MODEL PERFORMANCE</h1>
<%= test %>
<%= "#{controller_name}/#{action_name}" %>

and the controller articles_controller.rb

class ArticlesController < ApplicationController
    def new
    y = R.pull "capture.output(summary(rnorm(10)))"
    puts y
    end

    helper_method :test
    def test
    sample_size = 10
    R.eval "x <- rnorm(#{sample_size})"
    R.eval "summary(x)"
    R.eval "sd(x)"
    y = R.pull "capture.output(summary(rnorm(10)))"
    puts y
    end
end

And the Output ruby in web not showing def test... why ?

and why i use rinruby ?, because my professor order me. i don't want to, but and order is just and order.

just there is no error... but not showing...

Aucun commentaire:

Enregistrer un commentaire