×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
Index.html.rebの編集
<h1>一覧表示</h1>
<h2>
<%= link_to '新規追加' ,new_task_path, class: 'btn btn-primary' %>
</h2>
<% if flash[:notice] %>
<p><%= flash[:notice] %></p>
<% end %>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr class ="table-primary">
<th style="width: 20%">name
</th>
<th style="width: 60%">description
</th>
<th style="width: 20%">
</th>
</tr>
</thead>
<% @tasks.each do |task| %>
<tr>
<td>
<%=link_to task.name ,task_path(task.id) %>
</td>
<td>
<%= task.description %>
</td>
<td>
<%=link_to '[変更]', edit_task_path(task.id) , class: 'btn btn-warning btn-sm' %>|
<%=link_to '[削除]', task_path(task.id), class: 'btn btn-danger btn-sm',method: :delete,data:{confirm:'Sure?'} %>
</td>
</tr>
<% end %>
</table>
PR
1.プロジェクトの作成
rails new Proc_app
2.ディレクトリチェンジ
cd proc_app
3.btootstrap組み込み
前ブログ Node.jsのインストール(一回のみ)gemの編集
css>>cscss @import "bootstrap"
boot.rb ENV['EXECJS_RUNTIME'] = 'Node'
bundle install
4.modelの作成 Tは大文字
rails g model Task name:string discription:text
5.DBに反映
rails db:migrate
6.controller作成 小文字s付き
rails g controller tasks index new show edit
7.routesの変更
getに#
resurces :tests
root to: tests#index
rails new Proc_app
2.ディレクトリチェンジ
cd proc_app
3.btootstrap組み込み
前ブログ Node.jsのインストール(一回のみ)gemの編集
css>>cscss @import "bootstrap"
boot.rb ENV['EXECJS_RUNTIME'] = 'Node'
bundle install
4.modelの作成 Tは大文字
rails g model Task name:string discription:text
5.DBに反映
rails db:migrate
6.controller作成 小文字s付き
rails g controller tasks index new show edit
7.routesの変更
getに#
resurces :tests
root to: tests#index
RubyOnRails 5.2.3にbootstrapが入らない 2019/05/21
・windwos10
・rails 5.2.3
・gem BootStrap 4.1.3
散々悩んだがこのサイトに詳しい説明がある
https://high-programmer.com/2018/11/18/windows-ruby-on-rails-bootstrap/
著者に感謝
詳細はこのアドレスを参照いただくとして、
1.Node.jsをインストール (この時点の最新版12.2.0)
2.Gemfileに追記
3.applocatio.cssの拡張子を.SCSSに変更して追記
4.boot.rbに追記
5.bundle install
でOKです、ちゃんと起動しました
ENV。。。でエラーになっていたそうです。
index.html.rebに追記
綺麗な緑のボタンが表示されればOK
・windwos10
・rails 5.2.3
・gem BootStrap 4.1.3
散々悩んだがこのサイトに詳しい説明がある
https://high-programmer.com/2018/11/18/windows-ruby-on-rails-bootstrap/
著者に感謝
詳細はこのアドレスを参照いただくとして、
1.Node.jsをインストール (この時点の最新版12.2.0)
2.Gemfileに追記
gem 'bootstrap', '~> 4.1.3'
gem 'jquery-rails'
3.applocatio.cssの拡張子を.SCSSに変更して追記
@import "bootstrap";
4.boot.rbに追記
ENV['EXECJS_RUNTIME'] = 'Node'
5.bundle install
でOKです、ちゃんと起動しました
ENV。。。でエラーになっていたそうです。
index.html.rebに追記
<%= link_to "ブートストラップのボタン",new_task_path,class:"btn btn-success" %>
VB.NETでZXingを使ってQRコード生成
詳細は以下を参照するとして
https://github.com/micjahn/ZXing.Net/tree/master/docs
VS2017で実行テスト
AndroidでQRコードreadの定番はZXingなので、ZXingをテストで使用
1.vb.netでwindowsアプリのプロジェクトを作成
2.ツール Nugetパッケージマネージャー>>ソリューションのNugetパッケージマネージャ
の管理>>検索でZXing>>ZXing.netを選択しインストール
3.form1にピクチャーボックスを作成
4.ボタンを配置 以下をコーディング
Dim Wcode As New ZXing.BarcodeWriter
'種類
Wcode.Format = ZXing.BarcodeFormat.QR_CODE
'大きさ
詳細は以下を参照するとして
https://github.com/micjahn/ZXing.Net/tree/master/docs
VS2017で実行テスト
AndroidでQRコードreadの定番はZXingなので、ZXingをテストで使用
1.vb.netでwindowsアプリのプロジェクトを作成
2.ツール Nugetパッケージマネージャー>>ソリューションのNugetパッケージマネージャ
の管理>>検索でZXing>>ZXing.netを選択しインストール
3.form1にピクチャーボックスを作成
4.ボタンを配置 以下をコーディング
Dim Wcode As New ZXing.BarcodeWriter
'種類
Wcode.Format = ZXing.BarcodeFormat.QR_CODE
'大きさ
Wcode.Options.Height = 80
Wcode.Options.Width = 80
'マージン
Wcode.Options.Margin = 1
'文字
Wcode.Options.Hints(ZXing.EncodeHintType.CHARACTER_SET) = "Shift_JIS"
'エラー訂正
Wcode.Options.Hints(ZXing.EncodeHintType.ERROR_CORRECTION) = ZXing.QrCode.Internal.ErrorCorrectionLevel.L
Wcode.Options.Width = 80
'マージン
Wcode.Options.Margin = 1
'文字
Wcode.Options.Hints(ZXing.EncodeHintType.CHARACTER_SET) = "Shift_JIS"
'エラー訂正
Wcode.Options.Hints(ZXing.EncodeHintType.ERROR_CORRECTION) = ZXing.QrCode.Internal.ErrorCorrectionLevel.L
'実行
PictureBox1.Image = Wcode.Write("2019010212345678")
5.印刷の時はこのピクチャーボックスを印字
追記VB2019でも同じ手順で作成可能
追記PHPはhttps://github.com/khanamiryan/php-qrcode-detector-decoder
PictureBox1.Image = Wcode.Write("2019010212345678")
5.印刷の時はこのピクチャーボックスを印字
追記VB2019でも同じ手順で作成可能
追記PHPはhttps://github.com/khanamiryan/php-qrcode-detector-decoder