account working

This commit is contained in:
Aung Myo
2017-06-02 19:16:14 +06:30
parent 92a82f6e7f
commit 01fefe3b79
30 changed files with 619 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
<%= simple_form_for([:settings,@settings_account]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :title %>
<%= f.input :account_type, :collection => Lookup.collection_of("account_type") %>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>

View File

@@ -0,0 +1,2 @@
json.extract! settings_account, :id, :title, :account_type, :created_at, :updated_at
json.url settings_account_url(settings_account, format: :json)

View File

@@ -0,0 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_accounts_path %>">Account</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', settings_account: @settings_account %>
</div>

View File

@@ -0,0 +1,40 @@
<%= link_to 'New Settings Account', new_settings_account_path %>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<li>Account</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_account_path,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<br>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
<th style="width:40%">Title</th>
<th style="width:40%">Account Type</th>
<th style="width:20%">Action</th>
</tr>
</thead>
<tbody>
<% @settings_accounts.each do |account| %>
<tr>
<td><%= account.title %></td>
<td><%= account.account_type %></td>
<td>
<%= link_to 'Edit', edit_settings_account_path(account) %> |
<%= link_to 'Destroy', settings_account_path(account), method: :delete, data: { confirm: 'Are you sure?' } %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>

View File

@@ -0,0 +1 @@
json.array! @settings_accounts, partial: 'settings_accounts/settings_account', as: :settings_account

View File

@@ -0,0 +1,11 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_accounts_path %>">Account</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', settings_account: @settings_account %>
</div>

View File

@@ -0,0 +1,36 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<li>Account</li>
<span style="float: right">
</span>
</ul>
</div>
<br/>
<div class="card">
<div class="card-block">
<h4 class="card-title">Account</h4>
<table class="table">
<thead>
<tr>
<th>Title</th>
<th>Account type</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td><%= @settings_account.title %></td>
<td><%= @settings_account.account_type %></td>
<td><%= link_to 'Edit', edit_settings_account_path(@settings_account) %></td>
</tr>
</tbody>
</table>
</div>
</div>

View File

@@ -0,0 +1 @@
json.partial! "settings_accounts/settings_account", settings_account: @settings_account