Taking a value from a form in a view and storing it via a method

Hi Guys,

Im have an issue with capturing a value from a radial form and storing it…?

self.chosenbox = 0

h = DOND_Game::Game.new(STDIN, STDOUT)

#code from my .erb view file (this works fine)

Pick a Box?

<% i = 0 %> <% @cbox.each do |box| %>* /> <%= i+1 %>
<%i = i + 1%> <% end %> Choose!

#But somewhere there there is an issue, the self.chosenbox is overwritten and when it is called it returns blank.

post ‘/New’ do
params[:boxchose]= “”
@bn = params[:boxchose]
redirect ‘/Play’

def setchosenbox
self.chosenbox = @bn

sorry this is the view form code

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