Rails (Ruby)

rails generate controller Welcome index

Welcome#index

Find me in app/views/welcome/index.html.erb

erb value: <%= 3*2 %>

erb value: <%= @welcome_variable %>

erb value: <%= params[:name] %>


class WelcomeController < ApplicationController
def index
@welcome_variable=123
@param=params[:name]
end
end

<h1>Welcome#index</h1>
<p>Find me in app/views/welcome/index.html.erb</p>

erb value: <%= 3*2 %> <br>

erb value: <%= @welcome_variable %> <br>

erb value: <%= params[:name] %> <br>
class WelcomeController < ApplicationController
  def index
      @welcome_variable=123
      @param=params[:name]
  end
end
rails generate controller Welcome index

Commenti

Lascia un commento