Displaying 20 results from an estimated 4000 matches similar to: "form_for() and name"
2006 Aug 02
7
form_for not working with Markaby
I''m playing around with Markaby and I decided to write a little blog app.
I''m running into issues with forms however. If I use form_for the output of
the form gets swallowed. For example:
form_for :article, @article do |f|
f.text_field :title
f.check_box :published
f.text_area :description
f.text_field :pub_date
f.text_area :content
end
gets rendered as an empty form
2008 Apr 09
3
form_tag and form_for cause #protect_from_forgery errors
Hey All,
I''m trying to do a simple form_for (and I also get it with form_tag)
and I''m getting the following error:
ActionView::TemplateError (No :secret given to the
#protect_from_forgery call. Set that or use a session store capable
of generating its own keys (Cookie Session Store).) on line #2 of
users/new.fbml.erb:
1: <h1>Welcome To Courses, Let''s Get
2008 Jul 14
5
How can i use link_to_remote with in form_for
Hi
anybody plz help me how can i use link_to_remote with in form_for.. i
tried but no luck... if i use form_tag i can able to use link_to_remote
and made ajax call.but i need to use form_for ....can anyone help me how
can i do with this.Thanks in advance.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2010 May 19
2
customized form_for in ApplicationHelper
hello,
I want to make a table within a form by making a new form_tag. The
following code in ApplicationHelper fails:
def tabular_form_for(name, object = nil, options = nil, &proc)
concat("<table>", proc.binding)
form_for(name,
object,
(options||{}).merge(:builder => TabularFormBuilder),
&proc)
concat("</table>",
2008 Jan 14
5
Only "form_tag" support uploading file?
Hi, there:
I wanna use plug-in "file_column" to upload image to the server. In
my test app, the view is as follow & it works well:
====================
<h1>New entry</h1>
<%= error_messages_for ''entry'' %>
<% form_tag ''create'', :multipart => true do -%>
<p><label
2011 May 27
4
undefined method `model_name' for NilClass:Class in a form_for
Hi! I know that there are other topics about this issue, I read them and
I''m always blocked. Here is the error message:
undefined method `model_name'' for NilClass:Class
Extracted source (around line #30):
27:
28: <h2>Add Translation</h2>
29:
30: <%= form_for @new_trad do |f| %>
31: Locale: <%= f.text_field :locale %>
32: Key : <%=
2010 May 26
6
Understanding Form_for
OK, so I''m an absolute noob at Ruby on Rails. I''ve read a lot of
information I can find about form_for and most of them use form_for to
create new items that get saved into the database and can be viewed
later to edit, destroy, etc. In this case, the database will fill up
with whatever the user wrote and I just want my program to have no
information stored.
I''ve been
2006 Aug 11
2
Accessing belongs_to objects from a form_for context
In a form_for context, is there a way to access objects that are related
to the primary object with a belongs_to? I think an example will serve
best:
class User < ActiveRecord::Base
belongs_to :person
attr_accessor :username
end
class Person < ActiveRecord::Base
has_one :user
attr_accessor :first_name
end
<% form_for :user do |form| %>
<%= form.text_field
2008 Oct 15
2
Adding an id to form_tag
Hi all,
When using form_for it is easy to add an id to the form using :html =>
{:id => ''someid''}
However, how would one accomplish the same when using the form_tag ?
Thank you in advance,
Schalk
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post
2008 Mar 16
1
form_for error
Hi all,
I have the following code in my application layout:
<div id="utility">
<% if logged_in? %>
<%= link_to "Sign Out", logout_path %>
<% else %>
<%= link_to_function "Sign in",
"$(''signin'').toggle();$(''signin_link'').toggle()",
:id => "signin_link" %>
2011 Mar 04
1
form_for_tag - difference between that and form_remote_tag and form_for?
What''s the difference between form_for_tag and form_for? And between
form_remote_for and form_remote_tag?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe
2006 Jun 13
1
Easy question: need clarification of the form_for idiom
I''ve been trying wrap my head around one specific section of Recipe 57
in "Rails Recipes". The recipe is for image upload and processing.
I?m staring at:
<% form_for :image, @image, :url => {:action => ?create? }, :html =>
{multipart => true } do | f | %>
?
<% end %>
and the associated controller method ?create?:
def create
@image =
2013 Dec 10
2
form_tag + fields_for Rails 4
Hi There,
I''m trying to user fields_for inside a form_tag, but i can''t catch it
on my controller.
I just take some html code off to makes it easy to read
my view...
i''m using campuses_path(current_church, @campus) instead form_for
@campus, because my route is like
resources :campuses, :path => ":church/campuses"
<%= form_tag
2009 Mar 05
1
error_messages with form_tag
Hi
Am facing a problem in accessing the error_messages.
Actually am using form_tag is there any way with which i can access
error_messages with form_tag.
I don''t want to use form_for.
Thanks in Advancve
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
2008 Apr 19
1
form_for question
I have a following snippt to make a form.
<% form_for :post, @post, :url => { :action => "create" } do |f| -%>
<%- end ->
What does ":post" and "@post" do respectively?
If my understanding is correct, @post is there because I set "@post =
Post.new" in the action. But I don''t know what ":post " is for.
Tek
2009 Mar 27
0
How do I return values when using form_for
Hi I am trying to build a simple app where I''m trying to do pretty what
scaffold does. My question is when I am using ''form_for'' how do I return
the id while editing the application like its done in the form_tag
for example
<h1>Editing book</h1>
<% form_tag :action => ''update'', :id => @book do %>
<%= render :partial =>
2009 Mar 09
2
form_tag error: only get requests allowed
I am getting above error while updating an item using form_tag helper.
<h1>Edit Topic Item</h1>
<% form_tag edit_topic_item_path(@item.topic, @item), :html => { :method
=> :put} do %>
<%= render :partial => ''item_form'', :object => @item %>
<%= submit_tag ''Save'' %>
<% end %>
<%= link_to ''Add
2009 Mar 09
4
undefined method `symbol_path'
I am getting following error while creating a new topic using RESTful
design. But, everything works fine when I use <% form_tag :action =>
:create do %> .
ActionView::TemplateError (undefined method `symbol_path'' for
#<ActionView::Base:0xb72a2e40>) on line #3 of topics/new.rhtml:
1: <h1>New Topic</h1>
2:
3: <% form_tag :topic, :url => topics_path do %>
2006 Jun 26
2
How can I sort options in a select box?
Pretty much a newbie here, looking for help on select boxes in forms....
Is there any way in the view to sort the options of a drop-down select
box?
My current code (within a larger _form.rhtml file) is:
<div class="form-element">
<label for="asset_location_id">Location</label>
<%= select ''asset'', ''location_id'',
2006 Sep 24
8
form_for and Multiple Models Being Saved
Howdy Folks,
I want to use form_for to allow a user to submit a form that contains two
instances of the same model. They are entering calendar dates and I want
them to be able to submit 2 from the same form.
Ok, so, using form_for, what is the best way to do this? form_for seems to
be setup to handle a single instance in that it wants a name for the
variable, etc...
Has someone else done this?