Created
June 2, 2017 09:11
-
-
Save sushant12/278f66caa554933f295484f19496e40e to your computer and use it in GitHub Desktop.
fetching data for edit form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% DB.execute(“select rowid, * from tasks where rowid = #{id}”) do |row| %> | |
<form method=”post” action=”/update?id=<%= row[0]%>”> | |
Task Name: <input type=”text” name=”task” value=”<%= row[1] %>”> | |
Finished?: <input type=”checkbox” name=”finished” value=”1" <% if(row[2] == 1) %> checked <% end%>> | |
<input type=”submit” value=”Update” > | |
</form> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment