开发者

How do I move something in Rails?

开发者 https://www.devze.com 2023-02-26 19:54 出处:网络
I\'m a programming noob, and learning Rails. I\'m making a GTD webapp for fun, and I\'d liketo make a \"done\" section. In other words, I have a link that says \"Done!\" and I want that to move the cu

I'm a programming noob, and learning Rails. I'm making a GTD webapp for fun, and I'd like to make a "done" section. In other words, I have a link that says "Done!" and I want that to move the current task into a done page, instea开发者_如何学Cd of index.html.erb. All I know about Rails is what was in the official beginner tutorial.


It sounds like you want to set a property like 'completed' on a task. There are a lot of things that have to happen for this to work

Your task model needs to have a property like 'completed' Your controller needs to have an action to mark as completed (you can possibly just use the standard 'update' action..) You need to have a route to that action Your view needs to call that action

0

精彩评论

暂无评论...
验证码 换一张
取 消