开发者

Rails validation

I am suffering a issue with rails server side validation. Can some one help me out from this?

situation is :

I am creating dynamic for and its elements also dynamic.My application will generate the some HTMl code. Which can we use in any form or blog..

I applying the server side validation. But due to dynamic elements .I am not able to store the last entered value in to the elements. AS we normally does in PHP if user input something wrong we don't put the field empty. So I need to find a mechanism which fills the older values into the elements,If something went wrong.

This is the code into controller which is I'm using to show the form :

render :layout => false,:template=>'buildders/rander_form'

and view of rander_form.html.erb has

<%= render :file=>RAILS_ROOT+'/开发者_如何学Pythonpublic/forms/form_'+@form_name+'.html.erb' %>

where @form_name is a dynamic form name(which have HTML code).

Can some one help me?


don't put erb files in public, people can download them by entering the file path in the url

also why not move that code out of the erb template into the controller?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜