我正在尝试在ubuntu 9.10下运行RoR服务器:
> ruby script/server
> => Booting WEBrick
> => Rails 2.3.4 application starting on http://0.0.0.0:3000
> /var/lib/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:271:in
> `require_frameworks': no such file to
> load -- net/https (RuntimeError)
> from /var/lib/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:134:in
> `process'
> from /var/lib/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in
> `send'
> from /var/lib/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in
> `run'
> from /home/ockonal/Programming/RoR/demo/demo/config/environment.rb:9
> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require'
> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
> `require'
> from /var/lib/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in
> `require'
> from /var/lib/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in
> `new_constants_in'
> from /var/lib/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in
> `require'
> from /var/lib/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:84
> from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
> …Run Code Online (Sandbox Code Playgroud) 我在后端有两个表用户和费用.UserId是Expenses表的foreignKey.我需要将UserId从Usercontroller传递给ExpenseController,以便根据用户ID保存费用信息.但是有两个问题.
请查看以下代码.希望您能够帮助我.
// UserController的
public ActionResult Index()
{
return View(db.Users.ToList());
}
Run Code Online (Sandbox Code Playgroud)
// Inedx View(用户)
<%= Html.ActionLink("Expenses", "Index", "Expense", new { id=item.Id}, null)%>
Run Code Online (Sandbox Code Playgroud)
// ExpenseController
public ActionResult Index(int id)
{
ViewData["id"] = id;
return View(db.Expenses.Where(x => x.Users.Id == id).ToList());
}
Run Code Online (Sandbox Code Playgroud)
//索引视图(费用)
<%= Html.ActionLink("Create New", "Create", new { id=ViewData["id"]})%>
Run Code Online (Sandbox Code Playgroud)
// 费用控制器(创建)
public ActionResult Create(int id)
{
//ViewData["id"] = id;
return View();
}
Run Code Online (Sandbox Code Playgroud)
//创建视图
<% using (Html.BeginForm()) {%>
<fieldset>
<legend>Fields</legend>
<p>
<label for="ExpenseTitle">ExpenseTitle:</label>
<%= Html.TextBox("ExpenseTitle") %>
<%= Html.ValidationMessage("ExpenseTitle", "*") …Run Code Online (Sandbox Code Playgroud) 可能重复:
是否有一个用于iPhone的库可以使用HMAC-SHA-1编码
尝试编写NSString sha1函数,但它返回null
目标C:SHA1
如何在iphone中计算NSString的SHA1?可以使用哪种api?
我有一个基于文档的应用程序,旨在处理现有文档,而不是创建新文档.
如何通过从Finder中打开应用程序来阻止应用程序创建新的空白文档?
我想number_format在PHP中使用函数.例如:
$number = 234.51;
echo number_format($number,2);
Run Code Online (Sandbox Code Playgroud)
这适用于浮点数,但我想将它用于不同的数字.如果数字是十进制且没有任何浮点数,则显示如下:145.00.我怎样才能解决这个问题?我的意思是我想根据需要显示尽可能多的浮点数,而不是更多.
$cc a.c
$./a.out < inpfilename
Run Code Online (Sandbox Code Playgroud)
我想在stdout上打印inpfilename.我怎么做 ?我在这里先向您的帮助表示感谢...
在PHP中,JavaScript的encodeURIcomponent相当于什么?
最近我在寻找图标(图形),但我看到一个非常有趣的链接,是一种名为Icon的语言,然后我想知道:
我有一个WebService,它作为Web服务Invokation的结果返回一个名为" CustomerResponse" 的ResponseObject .当我从头开始实现这个对象时,一切正常:在这种情况下,我的实现只包含所有需要的"简单类型",如字符串,整数,但没有对象引用/关联.
但是,我想要做的是"重用"现有的对象.我在我的域模型中有一个" Customer"对象,它在应用程序本身中使用.而不是愚蠢地或多或少地克隆Customer到"CustomerReponse"对象(通过再次手动键入所有成员/字段),我想通过扩展将CutomerResponse对象基于CustomerObject:
class CustomerResponse extends Customer
Run Code Online (Sandbox Code Playgroud)
==>问题是现在CustomerResponse包含一些从CustomerObject 继承的"内部"字段(如DatabaseID,Security-Stuff),我不希望通过Web服务公开这些字段.此外(和多数民众赞成目前的主要问题")Customer中还含有大量的'对象引用/协会’像其他对象Address,Orders,History我不想通过web服务或者暴露.(似乎阿帕奇CXF'评估’全Objectgraph并尝试将它们包含在ResponseObject中......)
==>是否可以基于现有对象"扩展"WebService响应对象,并以某种方式排除扩展超级类型的某些"成员/字段"?(所以我想排除一些成员(如DatabseID)和所有"对象关联",如(地址/订单/ Histroy).我怎样才能用注释和程序来完成这个?
非常感谢你!!一月
我想知道C/C++标准库中使用的命名约定是否有一个名称,或者至少是一个可以查找规则的备忘单.例如
push_back -- underscore used
setstate -- but not used here!
string::npos -- when to use abbreviations?
fprintf
...
Run Code Online (Sandbox Code Playgroud)
C/C++标准库中使用的命名约定是否具有特定名称?
c ×2
php ×2
asp.net ×1
asp.net-mvc ×1
c++ ×1
cocoa ×1
command-line ×1
encoding ×1
iphone ×1
javascript ×1
jax-ws ×1
nsdocument ×1
printf ×1
ruby ×1
sha1 ×1
shell ×1