lundi 17 septembre 2018

as at the touch of a button to pass its value to the function ruby

I have `

 <% for j in (1..9) %>
    <%= button_to j, {}, {class: "btn btn-secondary"}, :method => :get %>
    <% end %>

`

as when it pushes it to transfer its value to the function It function

 def show
    @some_params = params[:id]
    @file = File.open("#{Rails.root}/app/data/home_work_# 
    {@some_params}.xml", "r")
    @doc = Nokogiri::XML(@file)
    @attributes = @doc.at('subject')['id']
    @subjects = @doc.xpath("//subject")
    end

`

Aucun commentaire:

Enregistrer un commentaire