0
에서 PARAMS 새로운 객체를 생성 @post =내 컨트롤러와 행동이 다른 물체
내보기에서 다음 양식 Post.new : 나는에서 생성 할
<%= form_for(@post, :method => :get, :remote => true, :url => { :controller => "posts", :action => "new_posts_from_web" }) do |f| %>
<%= f.text_field :remote_posted_url%>
<%= f.submit "Find Images" %>
액션 new_posts_from_web 이전의 형태로 전송 PARAMS와 새 게시물, 나는 new_posts_from_web 작용이 있습니다
def new_posts_from_web
@post = Post.new(params[:id])
end
하지만 params없이 새 게시물을받습니다.
개체를 데이터베이스에 저장하지 않고도 다른 작업의 폼에서 매개 변수를 가져 오는 방법은 무엇입니까?
괜찮습니다. 고맙습니다! – hyperrjas