Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Comments Spam Blocker plugin for RailwayJS MVC framework
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
README.md
index.js
package.json

README.md

About

Comments Spam Blocker plugin for RailwayJS MVC framework.

Usage

npmfile.js require('railway-comments');

posts_controller.js

action(function show() { Comment.all({where: {postId: params.id}, order: 'created_at'}, function(err, comments) { render({ comments: comments }); }); });

comments_controller.js action(function index() { Comment.commentSave({limit: 10, page: page}, function (err, posts) { if (err) render({comments: comments}); }); });

app/views/posts/show.ejs: <%- view_comments(comments) %>
<% form_for(comment, {action: path_to.comments, method: 'POST'}, function (form) { %> Scrivi i tuoi commenti <%- errorMessagesFor(comment) %> <%- form.input("postId", {type: "hidden", value: post.id}) %> <%- form.label("Body", false) %> <%- form.textarea("content") %> <%- form.label("Nome visualizzato", false) %> <%- form.input("userName") %> <%- form.submit('Post Comment') %> <% }); %>

License

MIT

Something went wrong with that request. Please try again.