小编use*_*592的帖子

我如何使用javascript中的Rails.logger

我nside一个html.erb,我想使用记录器

<script type="text/javascript">
  $j(function(){

    $j('#AddQuestion').click(function(){
     //Send and http transaction to the server to get the address
      $j('#dialog').dialog(
        {buttons:{OK:function (event) {
                say('You clicked the ' + $(event.target).text() + ' button' );
              },  No:function (event) {
                say('You clicked the ' + $(event.target).text() + ' button' );
              }
                }
         });

      $j('#dialog').dialog('open');

    });
  });
</script>
Run Code Online (Sandbox Code Playgroud)

javascript jquery-ui ruby-on-rails-3

0
推荐指数
1
解决办法
1404
查看次数

我需要一个示例在rails 3.0中运行更新查询

如何在Rails中执行以下更新查询?我想在数据库中使用单个更新查询执行此操作.在伪代码中,我会写:

update answers set user_id = @user.id where answered_by=@user.email and user_id = 0
Run Code Online (Sandbox Code Playgroud)

在SQL中它可能是这样的:

UPDATE `answers` SET user_id = '123' WHERE answered_by = 'email@example.com' and user_id = 0
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails-3

0
推荐指数
1
解决办法
1032
查看次数

标签 统计

ruby-on-rails-3 ×2

javascript ×1

jquery-ui ×1