From 4e94e31aa0acda54ae962840b57ae42ca6e71185 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Wed, 25 Feb 2015 18:47:09 -0800 Subject: rails generate scaffold Download --- app/views/downloads/_form.html.erb | 37 +++++++++++++++++++++++++++++++++ app/views/downloads/edit.html.erb | 6 ++++++ app/views/downloads/index.html.erb | 35 +++++++++++++++++++++++++++++++ app/views/downloads/index.json.jbuilder | 4 ++++ app/views/downloads/new.html.erb | 5 +++++ app/views/downloads/show.html.erb | 29 ++++++++++++++++++++++++++ app/views/downloads/show.json.jbuilder | 1 + 7 files changed, 117 insertions(+) create mode 100644 app/views/downloads/_form.html.erb create mode 100644 app/views/downloads/edit.html.erb create mode 100644 app/views/downloads/index.html.erb create mode 100644 app/views/downloads/index.json.jbuilder create mode 100644 app/views/downloads/new.html.erb create mode 100644 app/views/downloads/show.html.erb create mode 100644 app/views/downloads/show.json.jbuilder (limited to 'app/views/downloads') diff --git a/app/views/downloads/_form.html.erb b/app/views/downloads/_form.html.erb new file mode 100644 index 0000000..1ab1879 --- /dev/null +++ b/app/views/downloads/_form.html.erb @@ -0,0 +1,37 @@ +<%= form_for(@download) do |f| %> + <% if @download.errors.any? %> +
+

<%= pluralize(@download.errors.count, "error") %> prohibited this download from being saved:

+ + +
+ <% end %> + +
+ <%= f.label :name %>
+ <%= f.text_field :name %> +
+
+ <%= f.label :filename %>
+ <%= f.text_field :filename %> +
+
+ <%= f.label :type %>
+ <%= f.text_field :type %> +
+
+ <%= f.label :description %>
+ <%= f.text_area :description %> +
+
+ <%= f.label :hits %>
+ <%= f.number_field :hits %> +
+
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/downloads/edit.html.erb b/app/views/downloads/edit.html.erb new file mode 100644 index 0000000..3b57a65 --- /dev/null +++ b/app/views/downloads/edit.html.erb @@ -0,0 +1,6 @@ +

Editing Download

+ +<%= render 'form' %> + +<%= link_to 'Show', @download %> | +<%= link_to 'Back', downloads_path %> diff --git a/app/views/downloads/index.html.erb b/app/views/downloads/index.html.erb new file mode 100644 index 0000000..c017aab --- /dev/null +++ b/app/views/downloads/index.html.erb @@ -0,0 +1,35 @@ +

<%= notice %>

+ +

Listing Downloads

+ + + + + + + + + + + + + + + <% @downloads.each do |download| %> + + + + + + + + + + + <% end %> + +
NameFilenameTypeDescriptionHits
<%= download.name %><%= download.filename %><%= download.type %><%= download.description %><%= download.hits %><%= link_to 'Show', download %><%= link_to 'Edit', edit_download_path(download) %><%= link_to 'Destroy', download, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Download', new_download_path %> diff --git a/app/views/downloads/index.json.jbuilder b/app/views/downloads/index.json.jbuilder new file mode 100644 index 0000000..3323b04 --- /dev/null +++ b/app/views/downloads/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@downloads) do |download| + json.extract! download, :id, :name, :filename, :type, :description, :hits + json.url download_url(download, format: :json) +end diff --git a/app/views/downloads/new.html.erb b/app/views/downloads/new.html.erb new file mode 100644 index 0000000..ac31df5 --- /dev/null +++ b/app/views/downloads/new.html.erb @@ -0,0 +1,5 @@ +

New Download

+ +<%= render 'form' %> + +<%= link_to 'Back', downloads_path %> diff --git a/app/views/downloads/show.html.erb b/app/views/downloads/show.html.erb new file mode 100644 index 0000000..276888a --- /dev/null +++ b/app/views/downloads/show.html.erb @@ -0,0 +1,29 @@ +

<%= notice %>

+ +

+ Name: + <%= @download.name %> +

+ +

+ Filename: + <%= @download.filename %> +

+ +

+ Type: + <%= @download.type %> +

+ +

+ Description: + <%= @download.description %> +

+ +

+ Hits: + <%= @download.hits %> +

+ +<%= link_to 'Edit', edit_download_path(@download) %> | +<%= link_to 'Back', downloads_path %> diff --git a/app/views/downloads/show.json.jbuilder b/app/views/downloads/show.json.jbuilder new file mode 100644 index 0000000..6bab62c --- /dev/null +++ b/app/views/downloads/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @download, :id, :name, :filename, :type, :description, :hits, :created_at, :updated_at -- cgit v1.2.3