Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- w pliku strona_controlerr.rb podmień
- def kalkulator
- @wynik = params[:x].to_i + params[:y].to_i
- end
- -----------------------------------------------------------
- w pliku routes.rb podmień
- get 'kalkulator/:x/:y' => 'strona#kalkulator'
- --------------------------------------------------------------
- w pliku strona\kalkulator.html.erb wklej
- <h3>WYNIK: <%= @wynik %></h3>
- ----------------------------------------------------
- w pliku aplication
- <li><%= link_to 'KALKULATOR', :action => 'kalkulator', :x => 1 , :y => 1 %></li>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement