search for: form_for

Displaying 20 results from an estimated 462 matches for "form_for".

2006 Apr 25
7
undefined method form_for ?
Seems the only issues I ever have with Rails are these bizarre fiddly little things that make no sense. Can''t for the life of me understand why I''m getting undefined method on form_for in a view? And it''s actually part of the acts_as_authenticated plugin that''s doing it. But how can it not know about form_for? -- Posted via http://www.ruby-forum.com/.
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 tag. The above code of course works fine in an rhtml...
2010 May 23
1
[Rails 3] Trouble with named routes and form_for
Hi guys, I''m having trouble getting named routes and form_for to play nicely in quite the way I would expect. Here''s a quick summary of what I''ve got going on: Named route: resources :thread, :class_name => "forum_thread" Controller name: forum_thread_controller Model object: forum_thread In both my new and edit actio...
2009 Aug 04
6
form_for
hi everybody... I have a form_for in that, onclicking submit button i am calling a javascript for validation.If validation fails that form_for doesnt do anything.But even the validation fails it goes to the controller and action. here my code: <%form_for :promotion_code, :url=>{:controller=>"home",:action=>&q...
2006 Oct 13
2
form_for() and name
how can i give name attributes for form_for(), so it will give an output like <form name="f">. it is because that i need to access the form name for javascript manipulation. as far as i know, name can only used in form_tag(), but i currently have more than 50 forms that built using form_for(). the structure is like this:...
2008 Apr 06
10
about the form_for ..
question one: is there any select box tag for form_for? now,perhaps i just can use the select or select_tag? question tow: i have a A model,it has one B such as: class A< ActiveRecord::Base belongs_to :B when i use the form_for tag,how can i output the variable name?like this: <%form_for :a,@a,:url=>{:controller=>"a",:act...
2007 Dec 28
1
Nested resources form_for problem
...:users do |user| user.resource :sreg10record end So a User is supposed to have (at most) one Sreg10record. The problem is in the views. I tried following this tutorial: http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial which proposes something like: <% form_for( [@user, @sreg10record] ) do |f| %> However, doing that yields "undefined method `has_key?'' for #<Sreg10record:0xb6f47bc4>". So I tried <% form_for( [:user, @sreg10record] ) do |f| %> as intended for namespaced resources, however that causes the ID of the record...
2011 Jan 05
16
Nicedit (rich text editor)
...query: ruby script/plugin install git://github.com/aaronchi/jrails.git nicEdit plugin: ruby script/plugin install git://github.com/sergio-fry/Simple-nicEdit.git Add js in layout: <%= javascript_include_tag ''nicEdit'', ''nicEditInit'' %> Use it in form <% form_for @item do |f| %> <%= f.rich_text_area :description %> <% end %> I have no results in my views and no javascript errors appears (checked with firebug). Could someone tell me if I have skipped something? Could someone recommend me other plugin or gem for this purpose? Thanks --...
2006 Aug 05
1
form_for and partials
I''m getting an error in the partial when i try <% form_for :name do |form| %> <%= render_partial "#{@current_stage}" %> <% end %> So I assume that form_for does not have scope in the partial? If that is the case what are my solutions... Do I have to stick a <% form_for in every partial, or do i just change all my i...
2009 Jul 01
1
form_for resources with :singular specified
...t ... not equipments. So I have the following: map.resources :equipment, :singular => :equipment_instance class Equipment < ActiveRecord::Base class EquipmentController < ApplicationController The problem comes in my _form.haml partial that is used by new.haml and edit.haml: - form_for @equipment do |f| This gives me an error saying "Only get and post requests are allowed. (ActionController::MethodNotAllowed)" I tried: - form_for @equipment, equipment_instance_path(@equipment) do |f| That gives the same error. There has to be something better than: - form_for @e...
2007 Dec 10
11
map.namespace, rake routes yields no POST URLs
routes.rb map.namespace :admin do |admin| admin.resources :cupcakes end rake routes cupcakes GET /cupcakes formatted_cupcakes GET /cupcakes.:format POST /cupcakes POST /cupcakes.:format That said, what the heck goes here: form_for(:cupcake, @cupcake, xxx_url) # ??? Calling create_admin_cupcake_url yields... undefined local variable or method ''create_admin_cupcake_url'' Additionally, calling form_for(@cupcake) yields... undefined method ''cupcake_path'' Finally, I''ve also tried.....
2010 Mar 06
7
form_for, submit, and parameters disappearing
Consider the following: -- 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 from this group, send email to
2009 Aug 11
5
Dynamic drop-downs in a form_for using AJAX remote_function - Help
...uick. I have what seems to be a fairly unique issue as I cannot find much out there that describes what I''m seeing. Hopefully it''s a very simple fix, and I simply can''t see the forest through all the trees! I am attempting to create 2 related drop-down lists in the same form_for, both using collection_select. On the first drop-down, I have an onChange "remote_function" call that I want to send an AJAX call to the controller and filter the list in the 2nd drop-down based on what was selected in the first. In the controller method, I then call page.replace_html to...
2008 Nov 04
3
Nester Resources, Routes and Class Inheritance
...mpany, Reference and Applicant... and References and Applicants just inherit from Company, and are basically companies with the type field set to reference... All companies can have a phone number associated with them, and phone number is a different model... I''m having trouble using the form_for method with a company that happens to be an Applicant... form_for( [ @company, @phone_number] ) tries to use the route applicant_phone_number however the only route that exists is company_phone_number, which is the one I want to use... I tried to create a route by creating a map.resource :applic...
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...
2006 Jun 02
1
form_for scope issue
Hi, I am just ran into the problem that I cannot access helper methods from within a form_for scope. I do have something like the following: <% form_for :potential_buyer, @potential_buyer, :url => { :action => "register" } do |f| %> <%= render(:partial => ''register_form'', :locals => { :f => f } ) %> <% end %> ----- I cannot...
2006 Apr 15
0
form_for, partials, and rjs
...add form fields to an existing form. So for example a user could fill out a form and optionally hit a link_to_remote and get another set of identical fields to fill before sending. This would mean he/she could add ex. more than one record in the same form. The original form was rendered with form_for and using a partial: <% form_for :example, @example, :url => example_url(:action => ''create_example'') do |f| %> <%= render :partial => ''shared/forms/example'', :locals => {:f => f} %> <% end %> And Im having so much fun with form...
2009 May 07
3
Add class to "form_for"
Hi, How can I add a class to a form generated thus: <% form_for :applicant, :url=> {:action => "index"} do |f| %> I tried: <% form_for :applicant, :url=> {:action => "index"}, :class => ''test'' do |f| %> but this didn''t work. Thanks for your help. -- Posted via http://www.ruby-forum.com/.
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 t...
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: &...