Rails 新手采坑记录

不带括号的方法调用之殇 在Rails integration test里面执行post请求: post room_messages_path target_room, message: {body: 'hello'}, token: 'user_token', format: :turbo_stream 你以为后面的message: {body: 'hello'}, token: 'user_token', format: :turbo_stream都是post的参数?room_messages_path的参数只是target_room? 其实错了!target_room, message: {body: 'hello'}, token: 'user_token', format: :turbo_stream都是room_messages_path的参数,post的参数只有一个,就是那个path:room_messages_path(target_room, message:…

Continue ReadingRails 新手采坑记录