search for: semantic_form_for

Displaying 10 results from an estimated 10 matches for "semantic_form_for".

2010 Sep 09
17
formtastic issue
Hello, I will try to explain it step by step :-) I just created a new rails 3 app, then I created a new controller... rails generate controller admin::users I didn''t forget to add the resources in the routes.rb file like this. namespace :admin do resources :users end Now I try to use formtastic to create the form but I get erorr that my users_path doesn''t exist?
2010 Jun 05
6
How do you update HABTM relationships or create.
Hi, I have a User model with a HABTM relation to a Role model and vice versa. So There''s a roles_users table that references :user and :role. I''m using formtastic, and in the user.edit.html.erb I have a line that outputs the roles as a multi-select list box. But the box is not showing the roles that have been assigned to the users. Another problem is that if I select a few
2013 Jan 27
0
Nested form for a has_one model that already exists
...Person (has_one :color) Color So I have this database full of already populated Color entries via a whole separate controller + views for creating Colors. When creating a person, I want to be able to select a Color object without creating it. So I''m not looking for something such as: = semantic_form_for @person do |form| = form.input :name = semantic_fields_for :color do |c| = c.input :hex = form.actions :submit This would create a Color model to be associated with a Person. I want something more along the lines of this functionality: = semantic_form_for @person do |form| = form.inpu...
2012 Sep 22
1
formtastic does not save at all
Rails 3.1.3 I am using Formtastic gem in order to deal with multi-select dependencies. <%= semantic_form_for(@give) do |f| %> <%= f.inputs do %> <%= f.input :departure, :collection => Departure.find(:all, :order=>:city).collect{ |c| [c.city,c.id]}, :required=>true %> <div id="destinationCity"> <%= render :partial => ''destination...
2010 Aug 17
2
[Form] Method POST & PUT problem
...ut a hidden field "_method" that has the value "put" does anyone knows why? Thanks, David Sousa Controller: ------------------------------- def new @user = @current_user end ------------------------------------------- View: ------------------------------------- <% semantic_form_for @user, :url => profile_reset_password_url do |form| -%> <% form.inputs -%> <%= form.input :password -%> <%= form.input :new_password -%> <%= form.input :new_password_confirmation -%> <% end -%> <%= form.buttons %> <% end -%> -------...
2010 Jan 20
0
need help with nested forms and habtm
...has_and_belongs_to_many :inquiries I''m on Rails 2.3.5 and formtastic 0.9.7 ### What I want ### I wanted to build a nested form (using formtastic + haml), so a User could enter his data and create an inquiry regarding several machines (he put into a cart in advance) so I set up this: - semantic_form_for @customer do |form| - form.inputs do = form.input :companyname = form.input :salutation, :as => :radio, :label => "Gender", :collection => [["Mister", "m"], ["Mrs.", "f"]] = form.input :first_name = form.inp...
2012 Apr 02
0
active admin saving selection from collection_select and passing to controller
hi i am using active admin for my app i have a partial with a drop down list where the menu and recipe are populated this page is to group the recipe in a menu _menu_recipe.html.erb <%= semantic_form_for [:admin, @menu_recipe] do |f| %> <p> <%= f.collection_select :recipe_id, Recipe.all,:id,:name,:prompt => true%> </p> <p> <%= f.collection_select :menu_id, Menu.all,:id,:name,:prompt => true%> </p> <%= f.buttons :commit %> <%end%> when e...
2012 Nov 12
1
undefined method `original_filename' for nil:NilClass
Hi, although I saw this problem in other blogs, I couldn''t make it works. My view: *<%= semantic_form_for :routes_status_race, :url => status_race_admin_routes_path do |f| %>* * <% contact_array = Contact.all.map {|contact| [contact.name, contact.id]}%>* * <% route_importer_array = RouteImporter.all.map {|importer| [importer.name, importer.id]}%>* * <%= f.inputs do%>* * &l...
2010 Jan 16
3
Formtastic and Access to Variables of Nested Model
...above in my builder, for instance for the hint or label. I''m sorry if I''m not making myself very clear. I''ve tried to put together an example with pseudo code for what I would like to do. I''ve put what I want to have appear as follows **expected value**. <% semantic_form_for @document do |f| %> <% f.inputs do %> <%= f.input :name %> <%= f.input :content %> <% end %> <% f.inputs :name => ''Option #%i:'', :for => :options do |c| %> <%= c.input :value, :label => **option "name" field...
2011 Feb 17
16
Unindent ERB output
Hi all, I''d like to unindent a block of ERB specifically to combat the extra spacing being added to content inside <textarea> by the browser. Is there such a feature in ERB? I shall denote indentation with underscores in the pseudo code example below. Thanks in advance, Khoan. myview.erb: <html ...> __<%= render ''form'' %> </html>