This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": 1, | |
"sort_order":0, | |
"children": [ | |
{ | |
"id": 3, | |
"sort_order":0, | |
"children": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.filter("filterTree", [ | |
"$filter", function($filter) { | |
return function(tree) { | |
var newTree = []; | |
angular.forEach(tree, function(node, index) { | |
var newNode; | |
newNode = { | |
id: node.id, | |
sort_order: index, | |
children: $filter('filterTree')(node.children) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.$watch "postPagination.cur", (newVal) -> | |
if typeof newVal != "undefined" && newVal | |
console.log newVal | |
$scope.loadPosts newVal | |
$window.history.pushState({},"",$scope.currentPath+"?page="+newVal) | |
$anchorScroll() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.$watch "postPagination.cur", (newVal) -> | |
if angular.isDefined newVal && newVal | |
$scope.loadPosts newVal | |
$window.history.pushState({},"",$scope.currentPath+"?page="+newVal) | |
$anchorScroll() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_topic | |
@topic = ForumTopic.find(params[:id]) | |
unless @topic | |
respond_to do |format| | |
format.html { redirect_to forum_path(params[:forum_id]) } | |
format.json { render json: {redirect: forum_path(params[:forum_id])}, status: 500 } | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
after_create :send_greeting | |
def send_greeting | |
SystemMessage.create(user_id: self.id, subject: t("messages.head.greeting"), text: render_to_string(partial:"messages/greeting", locals:{user:self})) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Message < ActiveRecord::Base | |
validates_presence_of :user_id, :head, :text | |
belongs_to :user | |
has_many :receivers, class_name: MessageReceiver, :dependent => :destroy | |
before_destroy :check_receivers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"forum_id"=>"19", | |
"topic_id"=>"1", | |
"id"=>"1", | |
"post"=> | |
{ | |
"id"=>1, | |
"text"=> | |
"Praesent sagittis ligula tortor, quis [b]pulvinar lectus[/b] condimentum vitae. Praesent id mattis orci. Donec gravida eros in neque ullamcorper blandit. Nulla mollis metus in mi rhoncus egestas id a diam. In arcu elit, tempor sed mi vel, iaculis accumsan nisi. Nullam adipiscing mattis orci, sit amet cursus diam tincidunt adipiscing. Nunc nec felis tincidunt, pulvinar eros sed, dictum urna. Integer bibendum purus mollis massa ultricies suscipit. Vivamus suscipit, libero sit amet venenatis feugiat, dui arcu mattis mi, vitae hendrerit lacus felis in dui. Suspendisse quis euismod tortor.", | |
"comment"=>"", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"text"=> | |
"Praesent sagittis ligula tortor, quis [b]pulvinar lectus[/b] condimentum vitae. Praesent id mattis orci. Donec gravida eros in neque ullamcorper blandit. Nulla mollis metus in mi rhoncus egestas id a diam. In arcu elit, tempor sed mi vel, iaculis accumsan nisi. Nullam adipiscing mattis orci, sit amet cursus diam tincidunt adipiscing. Nunc nec felis tincidunt, pulvinar eros sed, dictum urna. Integer bibendum purus mollis massa ultricies suscipit. Vivamus suscipit, libero sit amet venenatis feugiat, dui arcu mattis mi, vitae hendrerit lacus felis in dui. Suspendisse quis euismod tortor.", | |
"char_id"=>1, | |
"user_id"=>current_user.id, | |
"ip"=>request.remote_ip, | |
"topic_id"=>params[:id] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/marcele/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require': no implicit conversion of Symbol into String (TypeError) | |
from /home/marcele/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require' | |
from /home/marcele/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each' | |
from /home/marcele/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require' | |
from /home/marcele/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each' | |
from /home/marcele/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require' | |
from /home/marcele/.rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require' | |
from /home/marcele/www/eveice/config/application.rb:14:in `<top (required)>' | |
from /home/marcele/.rvm/gems/ruby-2.1.2@eveice/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:146:in `require' | |
from /home/ma |