Automatically fill in form fields in Rails? -


Let's say you have a simple form of creating a new article object in your application.

@writing for & lt;% form_ F | & Gt%; & Lt; P & gt; Name: & lt; Br / & gt; & Lt;% = f.text_field: name% & gt; & Lt; / P & gt; & Lt; P & gt; Link: & lt; Br / & gt; & Lt;% = f.text_field: link% & gt; & Lt; / P & gt; & Lt; P & gt; & Lt;% = submit_tag% & gt; & Lt; / P & gt;

I am using RSS feeds parser feedtals to get article names, but I do not automatically fill in the form fields with data that is accessible elsewhere . It is said that the name of the article is accessible through counseling [: name]. How can Paramaster get the name of that article from [: name] (or parameter [: link]) without the form field in which to write it? I do not want to automatically create an article object because either the user might want to modify a little name.

"post-text" itemprop = "text">

If you pass the information you article the constructor to new If you want to display in action, then the form will be filled throughout the form, although a new object has been installed, it will not be maintained for DB because there is no saving method at any point. This action will be done in the making.

  def new @article = Article.new: name => "Steve Graham's Crazy Blog",: link = & gt; Answer "Http://swaggadocio.com/" Format | Format.html # new.html.erb format.xml {Render: xml = & gt; @ Post} End End  

Without knowing more about your app logic, how can I help parts to be stitched together and can not help you get it almost there.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -