Skip to content

Commit

Permalink
Add Sprockets example
Browse files Browse the repository at this point in the history
  • Loading branch information
the-teacher committed Sep 17, 2023
1 parent 68916cf commit 7f4b79f
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ Save hours, days or weeks on setting up a typical Rails app.
<td><b><a href="https://github.com/rails/importmap-rails">Import Maps</a></b></td>
<td>Rails' recommended way to process JavaScript</td>
</tr>
<tr>
<td><img width="100px" alt="sprockets" src="Rails7StartKit/assets/images/sprockets.png"></td>
<td><b><a href="https://github.com/rails/sprockets">Sprockets</a></b></td>
<td>Rack-based asset packager</td>
</tr>
<tr>
<td colspan="3"><h3>Application Configuration</h3></td>
</tr>
Expand Down
Binary file added Rails7StartKit/assets/images/sprockets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/Rails7.StartKit-sprockets.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions app/assets/stylesheets/demo/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,11 @@ em.tsh {
border-radius: 4px;
background-color: rgb(231, 248, 255);
}

.Rails7startkit-logo {
background-image: url('Rails7.StartKit-sprockets.jpg');
background-size: contain;
background-color: rgb(236, 231, 231);
width: 100px;
height: 30px;
}
2 changes: 2 additions & 0 deletions app/controllers/demo_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ def index
render 'articles/articles_list'
end

def tools; end

def articles_list
render 'articles/articles_list'
end
Expand Down
32 changes: 32 additions & 0 deletions app/views/demo/tools.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<%= render partial: 'demo/common_info', locals: { file: __FILE__ } %>

<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Logo</th>
<th scope="col">Name</th>
<th scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td><%= image_tag '/Rails7.StartKit.jpg', width: '100px' %></td>
<td>Rails 7. Start kit</td>
<td>Instant Rails on Any Platform</td>
</tr>
<tr>
<th scope="row">2</th>
<td><%= image_tag 'Rails7.StartKit-sprockets.jpg', width: '100px' %></td>
<td>Rails 7. Start kit</td>
<td>Instant Rails on Any Platform</td>
</tr>
<tr>
<th scope="row">3</th>
<td><div class="Rails7startkit-logo" /></td>
<td>Rails 7. Start kit</td>
<td>Instant Rails on Any Platform</td>
</tr>
</tbody>
</table>
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# Defines the root path route ("/")
root 'demo#index'
get '/tools', to: 'demo#tools'

get '/articles_list', to: 'demo#articles_list'
get '/articles_cache', to: 'demo#articles_cache'
Expand Down

0 comments on commit 7f4b79f

Please sign in to comment.