ruby on rails - Static Pages, RoR Apps, Forms and Databases -
i brought in static website brand new ror app. dropped entire directory public folder wouldn't have change application layout. want capture data 1 of static pages forms...i have following code in static page it's not correctly saving database.
#public/test/index.html <form action="resellers#create" method="post"> <label> <input id="number" type="text" placeholder="enter number"/> </label> <label> <input id="type" type="text" name="email" placeholder="email"/> </label> </form>
resellers#create
isn't actual form action can submit in browser. that's way rails refers in routes. you'll need run rake routes
, or if you're using ror 4+, visit /rails/info/routes
in development mode see route resellers#create
pointing to, post /resellers
.
however, unless set in configuration, can't submit form because rails smart , wants secure token each form submission prevent forgeries , other nasty things. you're better off having static website point form , making route form it's part of static website.
Comments
Post a Comment