account working
This commit is contained in:
14
app/views/settings/accounts/_form.html.erb
Normal file
14
app/views/settings/accounts/_form.html.erb
Normal 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 %>
|
||||
|
||||
@@ -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)
|
||||
10
app/views/settings/accounts/edit.html.erb
Normal file
10
app/views/settings/accounts/edit.html.erb
Normal 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>
|
||||
40
app/views/settings/accounts/index.html.erb
Normal file
40
app/views/settings/accounts/index.html.erb
Normal 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>
|
||||
1
app/views/settings/accounts/index.json.jbuilder
Normal file
1
app/views/settings/accounts/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @settings_accounts, partial: 'settings_accounts/settings_account', as: :settings_account
|
||||
11
app/views/settings/accounts/new.html.erb
Normal file
11
app/views/settings/accounts/new.html.erb
Normal 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>
|
||||
|
||||
36
app/views/settings/accounts/show.html.erb
Normal file
36
app/views/settings/accounts/show.html.erb
Normal 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>
|
||||
1
app/views/settings/accounts/show.json.jbuilder
Normal file
1
app/views/settings/accounts/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "settings_accounts/settings_account", settings_account: @settings_account
|
||||
Reference in New Issue
Block a user