Comments Spam Blocker plugin for RailwayJS MVC framework
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
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