안녕하세요 저는 작은 Sinatra 앱을 만들고 그 안에 투표 시스템을 만들려고합니다.Sinatra에서 투표 시스템을 만드는 데 유용한 보석을 아는 사람이 있습니까?
나는 acts_as_votable 보석을 사용해 보았지만 약간의 오류가 발생했습니다.
rake db:migrate
rake aborted!
TypeError: ActsAsVotable is not a class
는 여기에 내가 보석의 소스 코드에서 만들려고 내 마이그레이션 파일입니다. < 액티브 :: 마이그레이션 [5.1] 데프 CREATE_TABLE self.up ActsAsVotable 클래스 : | t 표가 할 일 |
t.references :votable, :polymorphic => true
t.references :voter, :polymorphic => true
t.boolean :vote_flag
t.string :vote_scope
t.integer :vote_weight
t.timestamps
end
if ActiveRecord::VERSION::MAJOR < 4
add_index :votes, [:votable_id, :votable_type]
add_index :votes, [:voter_id, :voter_type]
end
add_index :votes, [:voter_id, :voter_type, :vote_scope]
add_index :votes, [:votable_id, :votable_type, :vote_scope]
end
def self.down
drop_table :votes
end
end
나는 또한 보석 소스 코드에서 Acts_as_votable 모듈을 만들었습니다. 아래 코드를 참조하십시오
Sinatra에 대한 다른 제안이나 해결책은 무엇입니까?
는 보석으로 알고 있지만,이를 확인하지 마십시오. – Gerry
"[ask]"를 읽으십시오. 우리는 off-topic 리소스를 추천 해달라고 요청하고 있습니다. –