parent
869381d648
commit
d2b8e8dfe6
@ -0,0 +1,9 @@
|
||||
class AddressesController < ApplicationController
|
||||
def index
|
||||
@addresses = Address.all
|
||||
end
|
||||
|
||||
def show
|
||||
@address = Address.find params[:id]
|
||||
end
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
<h1>Addresses</h1>
|
||||
|
||||
<% if @addresses.present? %>
|
||||
<ul>
|
||||
<% @addresses.each do |address| %>
|
||||
<li><%= link_to address.value, address %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
@ -0,0 +1,27 @@
|
||||
<h1>Address</h1>
|
||||
|
||||
<dl>
|
||||
<dt><%= Address.human_attribute_name :value %></dt>
|
||||
<dd><%= @address.value %></dd>
|
||||
|
||||
<dt><%= Address.human_attribute_name :added_to_wallet %></dt>
|
||||
<dd><%= @address.added_to_wallet %></dd>
|
||||
|
||||
<dt><%= Address.human_attribute_name :op_return_value %></dt>
|
||||
<dd>
|
||||
<% if @address.op_return_value.nil? %>
|
||||
<i>None</i>
|
||||
<% else %>
|
||||
<%= @address.op_return_value %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
<dt><%= Address.human_attribute_name :op_return_updated_at %></dt>
|
||||
<dd>
|
||||
<% if @address.op_return_updated_at %>
|
||||
<%= localize @address.op_return_updated_at %>
|
||||
<% else %>
|
||||
<i>Never</i>
|
||||
<% end %>
|
||||
<dd>
|
||||
</dl>
|
@ -0,0 +1,13 @@
|
||||
require "test_helper"
|
||||
|
||||
class AddressesControllerTest < ActionDispatch::IntegrationTest
|
||||
test "should get index" do
|
||||
get addresses_index_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get show" do
|
||||
get addresses_show_url
|
||||
assert_response :success
|
||||
end
|
||||
end
|
Reference in new issue