Why is my button_to creating blank entries? Ruby on Rails 3 -


updated not using params passing params block

it seems parameters not getting passed controller action. i'm trying create entry svc_tickets table using button_to.

i'm getting blank entries table.

this button_to

<td class='create_service_ticket' style="width: 7%"><%= button_to 'create service ticket',                                                                           {controller: :svc_tickets,                                                                            action: 'create',                                                                            priority_level: 3,                                                                            summary: event[:signature_name].to_s,                                                                            description: 'description',                                                                            closed: 0} %> </td> 

svcticktscontroller

  def create     @svc_ticket = svcticket.new(params[:svc_ticket])     respond_to |format|       if @svc_ticket.save         format.html { redirect_to :back, notice: 'svc ticket created.' }         #format.json { render json: @svc_ticket, status: :created, location: @svc_ticket }       else         format.html { render action: "new" }         format.json { render json: @svc_ticket.errors, status: :unprocessable_entity }       end     end   end 

this page source

  <form action="/svc_tickets?closed=0&amp;description=description&amp;priority_level=3&amp;summary=drop+-+wp-admin+attempt" class="button_to" method="post">     <div>       <input type="submit" value="create service ticket">       <input name="authenticity_token" type="hidden" value="qwjft8jdeupxceqn3taodninwerveicikayjkboeots=">     </div>   </form> 

this functionality not implemented in rails 3. @ specification of method here. implemented in rails 4.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -