简体   繁体   English

什么是Rails相当于PHP的echo(“ok”)?

[英]What is the Rails equivalent to PHP's echo(“ok”)?

These special instructions for getting SWFupload to work on a mac in safari or firefox are only for PHP. 这些有关在safari或firefox中使用SWFupload在mac上工作的特殊说明仅适用于PHP。 Could some polyglot coders out there, translate this to Rails for me? 有些多语言编码器可以在那里,为我翻译成Rails吗?

PHP Version this quote is from here PHP版本 此引用来自此处

I added echo "OK"; 我添加了回音“OK”; to the end of upload.php and uploadphoto.php and my MAC user can use the uploader with Photopost. 到upload.php和uploadphoto.php结束,我的MAC用户可以使用上传器和Photopost。

I'm assuming their upload.php is the file that hosts the form.. maybe uploadphoto.php is an action in their controller? 我假设他们的upload.php是托管表单的文件..也许uploadphoto.php是他们控制器中的一个动作?

您不需要模板,控制器可以自己渲染文本:

render :text => "OK"

The equivalent in Rails is <%= "OK" %> as I have mentioned in the comment. 正如我在评论中提到的,Rails中的等价物是<%= "OK" %> I dont know about SWFUploader stuff. 我不知道SWFUploader的东西。

As far as I understand, you want to use a rails library for uploading files. 据我所知,您希望使用rails库来上传文件。

Use Paperclip for that, or google for other possible solutions. 使用Paperclip ,或谷歌寻求其他可能的解决方案。

And rails equivalent to PHP command echo("ok") would be I guess this code in view: <%= "ok" %> 并且相当于PHP命令echo("ok") rails将是我猜这个代码在视图中: <%= "ok" %>

相当于让您的操作视图由短语“确定”组成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM