我的表格有两张表,一张用于司机,另一张用于车辆 我想从车辆中选择vehicle_plate_no,其中驱动程序名称就像表单上的驱动程序名称文本输入一样。 通过以下示例,我可以返回所有驾驶员和车辆的信息,但无法获取自定义信息 使用表单文本输入值。
车辆模型表:
ay
车辆控制器表:
def translate(string)
string.split.map do |word|
if /\A[aeiou]/i.match(word)
"#{word}ay"
else
"#{word.chars.rotate(1).join}ay"
end
end.join(' ')
end
scalla tamplete:
public class vehicles extends Model{
@javax.persistence.Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id", updatable = false, nullable = false)
public Long Id;
public String vehicle name;
public String vehicle_plate_no;
public String created_at;
@Column(name="time", insertable=false ,columnDefinition="TIMESTAMP" )
@Temporal(TemporalType.TIMESTAMP)
private Date time;
@ManyToOne(cascade = CascadeType.ALL)
public Drivers driver;
public static Model.Finder<Long, vehicles > findvehicles = new
Finder(Long.class, vehicles.class);
public static List<vehicles> Allvehicles() {
return findvehicles .all();
}
}