Clean up frontend, DRY up templates
This commit is contained in:
		
							
								
								
									
										14
									
								
								app/views/application/_partsofspeech.html.erb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								app/views/application/_partsofspeech.html.erb
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
<h1>Parts of Speech</h1>
 | 
			
		||||
<table>
 | 
			
		||||
  <tr>
 | 
			
		||||
    <td><b>Part of Speech</b></td>
 | 
			
		||||
    <td><b>Definition</b></td>
 | 
			
		||||
  </tr>
 | 
			
		||||
<% parts_of_speech.each do |item| %>
 | 
			
		||||
  <tr>
 | 
			
		||||
    <td><b><%= item.pos %></b></td>
 | 
			
		||||
    <td><%= item.definition %></td>
 | 
			
		||||
  </tr>
 | 
			
		||||
<% end %>
 | 
			
		||||
</table>
 | 
			
		||||
 | 
			
		||||
@@ -1,39 +1,9 @@
 | 
			
		||||
<h1>Dictionary#index</h1>
 | 
			
		||||
<p>Find me in app/views/dictionary/index.html.erb</p>
 | 
			
		||||
<br/>
 | 
			
		||||
<br/>
 | 
			
		||||
 | 
			
		||||
<%= sanitize alphabetical_links, tags: ["a"] %>
 | 
			
		||||
 | 
			
		||||
<p><%= @parts_of_speech.count %> parts of speech entries in database</p>
 | 
			
		||||
<h1>Parts of Speech</h1>
 | 
			
		||||
<table>
 | 
			
		||||
  <tr>
 | 
			
		||||
    <td><b>Part of Speech</b></td>
 | 
			
		||||
    <td><b>Definition</b></td>
 | 
			
		||||
  </tr>
 | 
			
		||||
<% @parts_of_speech.each do |item| %>
 | 
			
		||||
  <tr>
 | 
			
		||||
    <td><b><%= item.pos %></b></td>
 | 
			
		||||
    <td><%= item.definition %></td>
 | 
			
		||||
  </tr>
 | 
			
		||||
<% end %>
 | 
			
		||||
</table>
 | 
			
		||||
<p><%= @words.count %> word entries in database</p>
 | 
			
		||||
 | 
			
		||||
<h1>Words</h1>
 | 
			
		||||
<% @words.each do |word| %>
 | 
			
		||||
  <h2><%= word.word %></h2>
 | 
			
		||||
  <%= render "application/definitions", word: word %>
 | 
			
		||||
  <!--
 | 
			
		||||
  <table>
 | 
			
		||||
    <tr>
 | 
			
		||||
      <td><b>Part of Speech</b></td>
 | 
			
		||||
      <td><b>Definition</b></td>
 | 
			
		||||
    </tr>
 | 
			
		||||
  <% word.definitions.each do |definition| %>
 | 
			
		||||
    <tr>
 | 
			
		||||
      <td><b><%= definition.pos %></b></td>
 | 
			
		||||
      <td><%= definition.definition %></td>
 | 
			
		||||
    </tr>
 | 
			
		||||
  <% end %>
 | 
			
		||||
  </table>
 | 
			
		||||
  -->
 | 
			
		||||
<% end %>
 | 
			
		||||
<%= render "partsofspeech", parts_of_speech: @parts_of_speech %>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,10 @@
 | 
			
		||||
<div>
 | 
			
		||||
  <%= @letter.to_s %>
 | 
			
		||||
  <h1><%= @letter.to_s %></h1>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<% @words.each do |word| %>
 | 
			
		||||
  <div>
 | 
			
		||||
    <h1><%= word.word %></h1>
 | 
			
		||||
    <h2><%= word.word %></h2>
 | 
			
		||||
    <%= render "definitions", word: word %>
 | 
			
		||||
  </div>
 | 
			
		||||
<% end %>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,3 +1,3 @@
 | 
			
		||||
<h1><%= @word.word %></h1>
 | 
			
		||||
 | 
			
		||||
<%= render "application/definitions", word: @word %>
 | 
			
		||||
<%= render "definitions", word: @word %>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user