我正在研究一個有兩種模型的項目:用戶和城市。 class User < ActiveRecord::Base
belongs_to :city
end
class City < ActiveRecord::Base
has_many :users
end
我將整個城市作爲一個整數(城市的主鍵)保存給用戶。一個用戶只能有一個城市和城市臺已經預先填充值: id | na
我有2類: class Solution
has_many :solution_votes
class SolutionVote
belongs_to :solution
我有我的看法是這樣的:
Proposed Solution A - 2 votes up - 5 votes down
Proposed Solution B - 1 vote u
我正在嘗試使用向量,因爲我剛開始學習,但被卡在這個錯誤。我試圖看看cpp的參考,並寫在它上面,但仍然出現錯誤。 #include<vector>
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
vector<string> vec;
vec.push_back("First");
v