Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update default bootstrap version to 4 (latest cdn) #746

Merged
merged 28 commits into from
May 15, 2018
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c90eeac
Update bootstrap 3 to 4
ChangJoo-Park Apr 11, 2018
c9071e8
Update bootstrap 3 to 4 for ecr
ChangJoo-Park Apr 11, 2018
9cc98cd
Update for bootstrap 4, add row class div
ChangJoo-Park Apr 11, 2018
f13dd97
Add col-sm for bootstrap 4 row
ChangJoo-Park Apr 11, 2018
45aeb1e
#746 fix indentations
ChangJoo-Park Apr 12, 2018
06e7ff1
#746 Remove col-md-6 from index.slang.ecr
ChangJoo-Park Apr 12, 2018
0e78956
#746 change jquery-slim to jquery
ChangJoo-Park Apr 12, 2018
95457c5
#746 migrate pull-right to ml-auto for auth links
ChangJoo-Park Apr 12, 2018
3757408
#746 btn-xs to btn-sm. btn-xs is removed
ChangJoo-Park Apr 12, 2018
e98e61f
#746 btn-default has removed. change to btn-light
ChangJoo-Park Apr 12, 2018
156ea70
#746 update checkbox for bootstrap 4
ChangJoo-Park Apr 12, 2018
4a2a5c3
#746 vertical-align: middle; for bootstrap 4 tables
ChangJoo-Park Apr 12, 2018
600a273
#746 update alert classs for bootstrap 4
ChangJoo-Park Apr 12, 2018
a426e1b
#746 remove ml-auto, need to fix auth links are on the right side of …
ChangJoo-Park Apr 12, 2018
0feda91
#746 using only class and id for div
ChangJoo-Park Apr 12, 2018
06acf93
#746 fix checkbox template
ChangJoo-Park Apr 12, 2018
0d2903c
#746 remove checkbox class for testing
ChangJoo-Park Apr 12, 2018
c8d49a6
#746 FOR TEST update checkbox class
ChangJoo-Park Apr 12, 2018
ca90790
#746 Using only class name with div
ChangJoo-Park Apr 12, 2018
634b3ed
#746 pulling auth navigation item on the right side of navigation bar
ChangJoo-Park Apr 13, 2018
ad5b10b
Merge branch 'master' into bootstrap-4
robacarp Apr 13, 2018
e9dd38e
#746 replace indentation tab to spaces
ChangJoo-Park Apr 14, 2018
748b1b0
Merge branch 'master' into bootstrap-4
faustinoaq Apr 18, 2018
62a489e
Merge branch 'master' into bootstrap-4
ChangJoo-Park Apr 21, 2018
962c176
Merge branch 'master' into bootstrap-4
faustinoaq Apr 30, 2018
67438aa
Merge branch 'master' into bootstrap-4
faustinoaq May 12, 2018
8ca4070
Merge branch 'master' into bootstrap-4
robacarp May 14, 2018
c1bf89f
Merge branch 'master' into bootstrap-4
faustinoaq May 14, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spec/support/fixtures/render_fixtures.cr
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ module RenderFixtures
<div class="form-group">
<textarea class="form-control" rows="10" name="content" placeholder="Content">out there in the cold</textarea>
</div>
<button class="btn btn-primary btn-xs" type="submit">Submit</button>
<a class="btn btn-default btn-xs" href="/posts">back</a>
<button class="btn btn-primary btn-sm" type="submit">Submit</button>
<a class="btn btn-light btn-sm" href="/posts">back</a>
</form>
HTML
end
Expand Down
6 changes: 3 additions & 3 deletions spec/support/sample/views/test/_form.slang
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ form action="/posts" method="post"
div.form-group
input.form-control type="text" name="title" placeholder="Title" value="hey you"
div.form-group
textarea.form-control rows="10" name="content" placeholder="Content" = "out there in the cold"
button.btn.btn-primary.btn-xs type="submit" Submit
a.btn.btn-default.btn-xs href="/posts" back
textarea.form-control rows="10" name="content" placeholder="Content" = "out there in the cold"
button.btn.btn-primary.btn-sm type="submit" Submit
a.btn.btn-light.btn-sm href="/posts" back
4 changes: 4 additions & 0 deletions src/amber/cli/templates/app/src/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@ h6, .h6 {
display: none;
}
}

.table td, .table th {
vertical-align: middle;
}
18 changes: 10 additions & 8 deletions src/amber/cli/templates/app/src/views/home/index.ecr.ecr
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<div id="logo" class="col-sm-6"></div>
<div class="col-sm-6">
<h2><%= "<" %>%= t "welcome_to_amber" %></h2>
<p>Thank you for trying out the Amber Framework. We are working hard to provide a super fast and reliable framework that provides all the productivity tools you are used to without sacrificing the speed.</p>
<div class="list-group">
<a class="list-group-item list-group-item-action" target="_blank" href="https://docs.amberframework.org">Getting Started with Amber Framework</a>
<a class="list-group-item list-group-item-action" target="_blank" href="https://github.com/veelenga/awesome-crystal">List of Awesome Crystal projects and shards</a>
<a class="list-group-item list-group-item-action" target="_blank" href="https://crystalshards.xyz">What's hot in Crystal right now</a>
<div class="row">
<div id="logo"></div>
<div class="col-sm-6">
<h2><%= "<" %>%= t "welcome_to_amber" %></h2>
<p>Thank you for trying out the Amber Framework. We are working hard to provide a super fast and reliable framework that provides all the productivity tools you are used to without sacrificing the speed.</p>
<div class="list-group">
<a class="list-group-item list-group-item-action" target="_blank" href="https://docs.amberframework.org">Getting Started with Amber Framework</a>
<a class="list-group-item list-group-item-action" target="_blank" href="https://github.com/veelenga/awesome-crystal">List of Awesome Crystal projects and shards</a>
<a class="list-group-item list-group-item-action" target="_blank" href="https://crystalshards.xyz">What's hot in Crystal right now</a>
</div>
</div>
</div>
17 changes: 9 additions & 8 deletions src/amber/cli/templates/app/src/views/home/index.slang.ecr
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
div#logo.col-sm-6
div.col-sm-6
h2 = t "welcome_to_amber"
p Thank you for trying out the Amber Framework. We are working hard to provide a super fast and reliable framework that provides all the productivity tools you are used to without sacrificing the speed.
div.list-group
a.list-group-item.list-group-item-action target="_blank" href="https://docs.amberframework.org" Getting Started with Amber Framework
a.list-group-item.list-group-item-action target="_blank" href="https://github.com/veelenga/awesome-crystal" List of Awesome Crystal projects and shards
a.list-group-item.list-group-item-action target="_blank" href="https://crystalshards.xyz" What's hot in Crystal right now
div.row
ChangJoo-Park marked this conversation as resolved.
Show resolved Hide resolved
div#logo
ChangJoo-Park marked this conversation as resolved.
Show resolved Hide resolved
div.col-sm-6
h2 = t "welcome_to_amber"
p Thank you for trying out the Amber Framework. We are working hard to provide a super fast and reliable framework that provides all the productivity tools you are used to without sacrificing the speed.
div.list-group
a.list-group-item.list-group-item-action target="_blank" href="https://docs.amberframework.org" Getting Started with Amber Framework
a.list-group-item.list-group-item-action target="_blank" href="https://github.com/veelenga/awesome-crystal" List of Awesome Crystal projects and shards
a.list-group-item.list-group-item-action target="_blank" href="https://crystalshards.xyz" What's hot in Crystal right now
19 changes: 11 additions & 8 deletions src/amber/cli/templates/app/src/views/layouts/application.ecr.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link rel="stylesheet" href="/dist/main.bundle.css">
<head>
<body>
Expand All @@ -19,11 +19,13 @@

<div class="container">
<div class="row">
<%="<"%>%- flash.each do |key, value| %>
<div class="alert alert-<%="<"%>%= key %>">
<p><%="<"%>%= flash[key] %></p>
</div>
<%="<"%>%- end %>
<div class="col-sm">
<%="<"%>%- flash.each do |key, value| %>
<div class="alert alert-<%="<"%>%= key %>">
<p><%="<"%>%= flash[key] %></p>
</div>
<%="<"%>%- end %>
</div>
</div>

<div class="row">
Expand All @@ -32,8 +34,9 @@
</div>
</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<script src="/dist/main.bundle.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ html
meta charset="utf-8"
meta http-equiv="X-UA-Compatible" content="IE=edge"
meta name="viewport" content="width=device-width, initial-scale=1"
link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"
link rel="stylesheet" href="/dist/main.bundle.css"

body
Expand All @@ -15,13 +15,15 @@ html
== render(partial: "layouts/_nav.slang")
div.container
div.row
- flash.each do |key, value|
div class="alert alert-#{key}"
p = flash[key]
div.col-sm
- flash.each do |key, value|
div class="alert alert-#{key}"
p = flash[key]
div.row
div.col-sm-12.main
== content

script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"
script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
script src="https://code.jquery.com/jquery-3.3.1.min.js"
script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"
script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"
script src="/dist/main.bundle.js"
8 changes: 4 additions & 4 deletions src/amber/cli/templates/auth/src/views/layouts/+_nav.ecr.ecr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<%="<"%>%- if (current_<%= @name %> = context.current_<%= @name %>) %>
<a class="nav-item pull-right" href="/signout">| Sign Out</a>
<a class="nav-item ml-auto" href="/signout">| Sign Out</a>
<%="<"%>%- active = context.request.path == "/profile" ? "active" : "" %>
<a class="nav-item <%="<"%>%= active %> pull-right" href="/profile"><%="<"%>%= current_<%= @name %>.email %></a>
<a class="nav-item <%="<"%>%= active %>" href="/profile"><%="<"%>%= current_<%= @name %>.email %></a>
<%="<"%>%- else %>
<%="<"%>%- active = context.request.path == "/signup" ? "active" : "" %>
<a class="nav-item <%="<"%>%= active %> pull-right" href="/signup">| Sign Up</a>
<a class="nav-item ml-auto <%="<"%>%= active %>" href="/signup">| Sign Up</a>
<%="<"%>%- active = context.request.path == "/signin" ? "active" : "" %>
<a class="nav-item <%="<"%>%= active %> pull-right" href="/signin">| Sign In</a>
<a class="nav-item <%="<"%>%= active %>" href="/signin">| Sign In</a>
<%="<"%>%- end %>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
- if (current_<%= @name %> = context.current_<%= @name %>)
a.nav-item.pull-right href="/signout"
a.nav-item.ml-auto href="/signout"
| Sign Out
- active = context.request.path == "/profile" ? "active" : ""
a class="nav-item #{active} pull-right" href="/profile"
a class="nav-item #{active}" href="/profile"
== current_<%= @name %>.email
- else
- active = context.request.path == "/signup" ? "active" : ""
a class="nav-item #{active} pull-right" href="/signup"
a class="nav-item ml-auto #{active}" href="/signup"
| Sign Up
- active = context.request.path == "/signin" ? "active" : ""
a class="nav-item #{active} pull-right" href="/signin"
a class="nav-item #{active}" href="/signin"
| Sign In
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="form-group">
<input class="form-control" type="password" name="password" placeholder="Password"/>
</div>
<button class="btn btn-primary btn-xs" type="submit">Register</button>
<button class="btn btn-primary btn-sm" type="submit">Register</button>
</form>
<hr/>
<%="<"%>%= link_to("Already have an account?", "/signin") -%>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ form action="/registration" method="post"
input.form-control type="email" name="email" placeholder="Email"
.form-group
input.form-control type="password" name="password" placeholder="Password"
button.btn.btn-primary.btn-xs type="submit"
button.btn.btn-primary.btn-sm type="submit"
| Register
<hr/>
== link_to("Already have an account?", "/signin")
2 changes: 1 addition & 1 deletion src/amber/cli/templates/auth/src/views/session/new.ecr.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="form-group">
<input class="form-control" type="password" name="password" placeholder="Password"/>
</div>
<button class="btn btn-primary btn-xs" type="submit">Sign In</button>
<button class="btn btn-primary btn-sm" type="submit">Sign In</button>
</form>
<hr/>
<%="<"%>%= link_to("Don't have an account yet?", "/signup") -%>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ form action="/session" method="post"
input.form-control type="email" name="email" placeholder="Email"
div.form-group
input.form-control type="password" name="password" placeholder="Password"
button.btn.btn-primary.btn-xs type="submit" Sign In
button.btn.btn-primary.btn-sm type="submit" Sign In
<hr/>
== link_to("Don't have an account yet?", "/signup")
4 changes: 2 additions & 2 deletions src/amber/cli/templates/auth/src/views/{{name}}/edit.ecr.ecr
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
<div class="form-group">
<input class="form-control" type="email" name="email" placeholder="Email" value="<%="<"%>%= <%= @name %>.email %>" />
</div>
<%="<"%>%= submit("Update", class: "btn btn-primary btn-xs") %>
<%="<"%>%= link_to("profile", "/profile", class: "btn btn-default btn-xs") %>
<%="<"%>%= submit("Update", class: "btn btn-primary btn-sm") %>
<%="<"%>%= link_to("profile", "/profile", class: "btn btn-light btn-sm") %>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ h1 Edit Profile
== csrf_tag
.form-group
input.form-control type="email" name="email" placeholder="Email" value="#{<%= @name %>.email}"
== submit("Update", class: "btn btn-primary btn-xs")
== link_to("profile", "/profile", class: "btn btn-default btn-xs")
== submit("Update", class: "btn btn-primary btn-sm")
== link_to("profile", "/profile", class: "btn btn-light btn-sm")
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1>Profile</h1>
<p>
<%="<"%>%= <%= @name %>.email %>
<%="<"%>%= link_to("edit", "/profile/edit", class: "btn btn-success btn-xs") %>
<%="<"%>%= link_to("edit", "/profile/edit", class: "btn btn-success btn-sm") %>
</p>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h1 Profile
p
== <%= @name %>.email
== link_to("edit", "/profile/edit", class: "btn btn-success btn-xs")
== link_to("edit", "/profile/edit", class: "btn btn-success btn-sm")
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
when "text" -%>
<%="<"%>%= text_area(name: "<%= field.name -%>", content: <%= @name %>.<%= field.name %>, placeholder: "<%= field.name.capitalize %>", class: "form-control", size: "30x10") -%>
<% when "boolean" -%>
<div class="checkbox">
<%="<"%>%= label(<%=":#{field.name}"%>) { check_box(<%=":#{field.name}, checked: #{@name}.#{field.name}.to_s == \"1\""%>) } -%>
<div class="form-check">
<%="<"%>%= label(<%=":#{field.name}"%>, class: "form-check-label") { check_box(<%=":#{field.name}, checked: #{@name}.#{field.name}.to_s == \"1\"", class: "form-check-input"%>) } -%>
</div>
<% when "reference" -%>
<%="<"%>%= label(<%=":#{field.name}"%>) -%>
Expand All @@ -32,6 +32,6 @@
<% end -%>
</div>
<% end -%>
<%="<"%>%= submit("Submit", class: "btn btn-primary btn-xs") -%>
<%="<"%>%= link_to("back", "/<%= Inflector.pluralize(@name) %>", class: "btn btn-default btn-xs") -%>
<%="<"%>%= submit("Submit", class: "btn btn-primary btn-sm") -%>
<%="<"%>%= link_to("back", "/<%= Inflector.pluralize(@name) %>", class: "btn btn-light btn-sm") -%>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
when "text" -%>
== text_area(name: "<%= field.name -%>", content: <%= @name %>.<%= field.name %>, placeholder: "<%= field.name.capitalize %>", class: "form-control", size: "30x10")
<%- when "boolean" -%>
div.checkbox
== label(<%=":#{field.name}"%>) do
== check_box(<%=":#{field.name}, checked: #{@name}.#{field.name}.to_s == \"1\""%>)
div.form-check
== label(<%=":#{field.name}"%>, class: "form-check-label") do
== check_box(<%=":#{field.name}, checked: #{@name}.#{field.name}.to_s == \"1\""%>, class: "form-check-input")
<%- when "reference" -%>
== label(<%=":#{field.name}"%>)
== select_field(name: "<%= field.name %>_id", collection: <%= field.name.capitalize %>.all.map{|<%= field.name %>| [<%= field.name %>.id, <%= field.name %>.id]}, selected: <%= @name %>.<%= field.name %>_id, class: "form-control")
<%- else -%>
== text_field(name: "<%= field.name %>", value: <%= @name %>.<%= field.name %>, placeholder: "<%= field.name.capitalize %>", class: "form-control")
<%- end -%>
<%- end -%>
== submit("Submit", class: "btn btn-primary btn-xs")
== link_to("back", "/<%= Inflector.pluralize(@name) %>", class: "btn btn-default btn-xs")
== submit("Submit", class: "btn btn-primary btn-sm")
== link_to("back", "/<%= Inflector.pluralize(@name) %>", class: "btn btn-light btn-sm")
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h2><%= Inflector.pluralize(display_name) %></h2>
</div>
<div class="col-sm-1">
<a class="btn btn-success btn-xs" href="/<%= Inflector.pluralize(@name) %>/new">New</a>
<a class="btn btn-success btn-sm" href="/<%= Inflector.pluralize(@name) %>/new">New</a>
</div>
</div>

Expand All @@ -24,9 +24,9 @@
<% end -%>
<td>
<span>
<%="<"%>%= link_to("read", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}", class: "btn btn-primary btn-xs") -%>
<%="<"%>%= link_to("edit", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}/edit", class: "btn btn-success btn-xs") -%>
<%="<"%>%= link_to("delete", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}?_csrf=#{csrf_token}", "data-method": "delete", "data-confirm": "Are you sure?", class: "btn btn-danger btn-xs") -%>
<%="<"%>%= link_to("read", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}", class: "btn btn-primary btn-sm") -%>
<%="<"%>%= link_to("edit", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}/edit", class: "btn btn-success btn-sm") -%>
<%="<"%>%= link_to("delete", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}?_csrf=#{csrf_token}", "data-method": "delete", "data-confirm": "Are you sure?", class: "btn btn-danger btn-sm") -%>
</span>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ div.row
div.col-sm-11
h2 <%= Inflector.pluralize(display_name) %>
div.col-sm-1
a.btn.btn-success.btn-xs href="/<%= Inflector.pluralize(@name) %>/new" New
a.btn.btn-success.btn-sm href="/<%= Inflector.pluralize(@name) %>/new" New
div.table-responsive
table.table.table-striped
thead
Expand All @@ -19,6 +19,6 @@ div.table-responsive
<%- end -%>
td
span
== link_to("read", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}", class: "btn btn-primary btn-xs")
== link_to("edit", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}/edit", class: "btn btn-success btn-xs")
== link_to("delete", "/<%= Inflector.pluralize(@name) %>/#{ <%= @name %>.id }?_csrf=#{csrf_token}", "data-method": "delete", "data-confirm": "Are you sure?", class: "btn btn-danger btn-xs")
== link_to("read", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}", class: "btn btn-primary btn-sm")
== link_to("edit", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}/edit", class: "btn btn-success btn-sm")
== link_to("delete", "/<%= Inflector.pluralize(@name) %>/#{ <%= @name %>.id }?_csrf=#{csrf_token}", "data-method": "delete", "data-confirm": "Are you sure?", class: "btn btn-danger btn-sm")
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p><%="<"%>%= <%= @name %>.<%= field.name %><%= field.reference? ? ".id" : "" %> %></p>
<% end -%>
<p>
<%="<"%>%= link_to("back", "/<%= Inflector.pluralize(@name) %>s", class: "btn btn-default btn-xs") -%>
<%="<"%>%= link_to("edit", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}/edit", class: "btn btn-success btn-xs") -%>
<%="<"%>%= link_to("delete", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}?_csrf=#{csrf_token}", "data-method": "delete", "data-confirm": "Are you sure?", class: "btn btn-danger btn-xs") -%>
<%="<"%>%= link_to("back", "/<%= Inflector.pluralize(@name) %>s", class: "btn btn-light btn-sm") -%>
<%="<"%>%= link_to("edit", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}/edit", class: "btn btn-success btn-sm") -%>
<%="<"%>%= link_to("delete", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}?_csrf=#{csrf_token}", "data-method": "delete", "data-confirm": "Are you sure?", class: "btn btn-danger btn-sm") -%>
</p>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ h1 Show <%= display_name %>
p = <%= @name %>.<%= field.name %><%= field.reference? ? ".id" : "" %>
<% end -%>
p
== link_to("back", "/<%= Inflector.pluralize(@name) %>", class: "btn btn-default btn-xs")
== link_to("edit", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}/edit", class: "btn btn-success btn-xs")
== link_to("delete", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}?_csrf=#{csrf_token}", "data-method": "delete", "data-confirm": "Are you sure?", class: "btn btn-danger btn-xs")
== link_to("back", "/<%= Inflector.pluralize(@name) %>", class: "btn btn-light btn-sm")
== link_to("edit", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}/edit", class: "btn btn-success btn-sm")
== link_to("delete", "/<%= Inflector.pluralize(@name) %>/#{<%= @name %>.id}?_csrf=#{csrf_token}", "data-method": "delete", "data-confirm": "Are you sure?", class: "btn btn-danger btn-sm")