Skip to content

Instantly share code, notes, and snippets.

@keita03301995
Last active March 22, 2016 08:43
Show Gist options
  • Save keita03301995/0f14e6ac94766894000d to your computer and use it in GitHub Desktop.
Save keita03301995/0f14e6ac94766894000d to your computer and use it in GitHub Desktop.
class TablesController < ApplicationController
def new
@table = Table.new
end
def edit
if params[:do_button]
con = ActiveRecord::Base.connection
con.execute(params[:table][:sql])
ret = con.select_rows("select * from sqlite_master where rootpage > 14")
flash[:danger] = "#{ret}"
@table = Table.new
render 'new'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment