diff options
author | DavisLWebb <davislwebb@ymail.com> | 2014-03-02 15:59:50 -0500 |
---|---|---|
committer | DavisLWebb <davislwebb@ymail.com> | 2014-03-02 15:59:50 -0500 |
commit | eaf3d3cddf418c560c9619f722ea1dbc5d6cc61a (patch) | |
tree | 85d2e147a410ae528425595282aa4d7235152df8 /app/views/pms | |
parent | b677983475513c78108406901fccd5cbe9604ca6 (diff) |
currently adding Session controller and view
Diffstat (limited to 'app/views/pms')
-rw-r--r-- | app/views/pms/_form.html.erb | 29 | ||||
-rw-r--r-- | app/views/pms/edit.html.erb | 6 | ||||
-rw-r--r-- | app/views/pms/index.html.erb | 31 | ||||
-rw-r--r-- | app/views/pms/index.json.jbuilder | 4 | ||||
-rw-r--r-- | app/views/pms/new.html.erb | 5 | ||||
-rw-r--r-- | app/views/pms/show.html.erb | 19 | ||||
-rw-r--r-- | app/views/pms/show.json.jbuilder | 1 |
7 files changed, 95 insertions, 0 deletions
diff --git a/app/views/pms/_form.html.erb b/app/views/pms/_form.html.erb new file mode 100644 index 0000000..480e308 --- /dev/null +++ b/app/views/pms/_form.html.erb @@ -0,0 +1,29 @@ +<%= form_for(@pm) do |f| %> + <% if @pm.errors.any? %> + <div id="error_explanation"> + <h2><%= pluralize(@pm.errors.count, "error") %> prohibited this pm from being saved:</h2> + + <ul> + <% @pm.errors.full_messages.each do |msg| %> + <li><%= msg %></li> + <% end %> + </ul> + </div> + <% end %> + + <div class="field"> + <%= f.label :author_id %><br> + <%= f.text_field :author_id %> + </div> + <div class="field"> + <%= f.label :recipient_id %><br> + <%= f.text_field :recipient_id %> + </div> + <div class="field"> + <%= f.label :message %><br> + <%= f.text_area :message %> + </div> + <div class="actions"> + <%= f.submit %> + </div> +<% end %> diff --git a/app/views/pms/edit.html.erb b/app/views/pms/edit.html.erb new file mode 100644 index 0000000..074a4fd --- /dev/null +++ b/app/views/pms/edit.html.erb @@ -0,0 +1,6 @@ +<h1>Editing pm</h1> + +<%= render 'form' %> + +<%= link_to 'Show', @pm %> | +<%= link_to 'Back', pms_path %> diff --git a/app/views/pms/index.html.erb b/app/views/pms/index.html.erb new file mode 100644 index 0000000..cb7fe4b --- /dev/null +++ b/app/views/pms/index.html.erb @@ -0,0 +1,31 @@ +<h1>Listing pms</h1> + +<table> + <thead> + <tr> + <th>Author</th> + <th>Recipient</th> + <th>Message</th> + <th></th> + <th></th> + <th></th> + </tr> + </thead> + + <tbody> + <% @pms.each do |pm| %> + <tr> + <td><%= pm.author %></td> + <td><%= pm.recipient %></td> + <td><%= pm.message %></td> + <td><%= link_to 'Show', pm %></td> + <td><%= link_to 'Edit', edit_pm_path(pm) %></td> + <td><%= link_to 'Destroy', pm, method: :delete, data: { confirm: 'Are you sure?' } %></td> + </tr> + <% end %> + </tbody> +</table> + +<br> + +<%= link_to 'New Pm', new_pm_path %> diff --git a/app/views/pms/index.json.jbuilder b/app/views/pms/index.json.jbuilder new file mode 100644 index 0000000..fcfca84 --- /dev/null +++ b/app/views/pms/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@pms) do |pm| + json.extract! pm, :id, :author_id, :recipient_id, :message + json.url pm_url(pm, format: :json) +end diff --git a/app/views/pms/new.html.erb b/app/views/pms/new.html.erb new file mode 100644 index 0000000..29e24ec --- /dev/null +++ b/app/views/pms/new.html.erb @@ -0,0 +1,5 @@ +<h1>New pm</h1> + +<%= render 'form' %> + +<%= link_to 'Back', pms_path %> diff --git a/app/views/pms/show.html.erb b/app/views/pms/show.html.erb new file mode 100644 index 0000000..5ee483f --- /dev/null +++ b/app/views/pms/show.html.erb @@ -0,0 +1,19 @@ +<p id="notice"><%= notice %></p> + +<p> + <strong>Author:</strong> + <%= @pm.author %> +</p> + +<p> + <strong>Recipient:</strong> + <%= @pm.recipient %> +</p> + +<p> + <strong>Message:</strong> + <%= @pm.message %> +</p> + +<%= link_to 'Edit', edit_pm_path(@pm) %> | +<%= link_to 'Back', pms_path %> diff --git a/app/views/pms/show.json.jbuilder b/app/views/pms/show.json.jbuilder new file mode 100644 index 0000000..94252e9 --- /dev/null +++ b/app/views/pms/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @pm, :id, :author_id, :recipient_id, :message, :created_at, :updated_at |