<% semantic_form_for(@product, :html => {:multipart => true}) do |f| %>
<% f.inputs do %>
<%= f.input :name %>
<%= f.input :price %>
<%= f.input :pno %>
<%= f.input :description %>
<%= f.input :shop_category %>
<% end %>
<% end %>
Product belongs to Shop_category, Shop_category belongs t...
As basic as it sounds, I can't make the date_helper default to a date, as in:
- semantic_form_for resource do |f|
- f.inputs do
= f.input :issued_on, :default => Date.today
= f.buttons
The above just renders blank columns if resource does not have a date.
Would appreciate any pointer on what I'm possibly doing wrong.
...
I'm trying to access a date variable from a form individually to the other variables. The form is a formtastic plugin form. The issue I am facing is that the date is a three-part dropdown and simply doing params[:friend][:born_on] doesn't seem to be doing the trick as it returns NULL.
Here is my parameters output;
Parameters: {"comm...
Hi, all.
Sometimes we need form without model creation - for example search field or email, where should be send some instructions. What is the best way to create this forms? Can i create virtual model or something like this? I'd like to use formtastic, but not form_tag.
...
Hi guys,
I was wondering how can I specify the method to send the data from a Formtastic form.
It usually uses POST, but I'd like it to use GET in some cases (i.e. for a search form).
Is it possible/easy?
...
How do I instruct Formtastic select to only display values based on a condition?
- semantic_form_for @member do |f|
- f.inputs do
= f.input :person
= f.input :role, :include_blank => false
= f.input :active
I only want the :person input to list/select people who are active i.e. person.active == true. I tried to pass a co...
is it possible to use Ajax and make the result as select list with Formtastic?
example:
semantic_form_for @user, :url => profile_path(@profile.id) do |f|
- f.inputs do
- f.input :province, :label => "Province", :as => :select, :collection => ["province-1", "province-2", "province-3"]
- f.input :city, :label => "City", :as => ...
I'm using the following code for a date field:
<%= f.input :date_of_birth, :selected => nil,
:order => [:day, :month, :year],
:prompt => {:day => "Day", :month => "Month", :year => "Year"},
:start_year => Time.now.year - 15,
:end_year => Time.now.year - 100 %>
Everything works as expected, except for :sel...
I use formtastic to create new and edit forms for my resources.
with something like f.inputs it fetches and displays all my fields automatically.
I would like to know if there is something similar that makes life easier to write the index and show views. I tried using formtastic with 'disable' to show a readonly form but that's not onl...
I use Formtastic. Now I would like to add model translations for some fields. I look at Globalize2 and it seems like what I need. But I have no idea how to integrate it with Formtastic. Does anybody have such experience?
...
I would like to use formtastic to create form but I don't have a model associated with that (login form with username, password and openid URL).
Of course I could create a model to do that but that model was just a hack without any useful code in it.
...
following up with this topic:
http://stackoverflow.com/questions/1992094/one-to-many-relationship-in-ror
I am creating a category that may have many products. So, I use the Formtastic as user Chandra Patni suggested. But I find there is a problem when I added attr_accessible to the product.rb.
class Product < ActiveRecord::Base
valid...
Given
As the User, I am at a nested new vendors/5/reviews/new. In addition to :params that will get written to the Review model, I need to be able to include tags that belong to the Vendor model.
I have used acts_as_taggable_on (http://github.com/mbleigh/acts-as-taggable-on):
class Vendor....
acts_as_taggable_on :tags, :competito...
I'm building an app, where users can give comments by just leaving their email to the comment.
I want them to be able to register directly from there, by a link with their email adress as a param (like: <%= link_to register_path(:email => @comment.email %> ) - so there is no existing user record yet.
this should be done by applying a va...
Hi,
I have 2 questions about authlogic:
1 - how to get cause of unsuccessful session creation (for example - not confirmed, blocked, wrong pass etc) to use it in app logic (route to another page for confimation, or re-enter pass etc)?
2 - question about integration formtastic and authlogic. How to show error messages on session creatio...
I use the superb Formtastic plugin for Ruby on Rails.
Does anybody know how to include a blank (option), when using a custom collection?
When I try:
<%= f.input :organizations, :collection => Organization.all(:order => :name), :include_blank => true %>
I get the select box with the collection, but NOT a blank...
...
Now with Formtastic I have plain select:
= f.input :category, :as => :select, :include_blank => false, :collection => subcategories
Here I show only children categories. I use acts_as_tree plugin for parent-child relationship. I would like to show parent categories as well.
Formtastic generated select should look like this one:
<sel...
Using formtastic, I have a quantity field and unit field that asks for the quantity of the item and the unit it's measured in.
My problem, is that I would like the unit box to display along side the quantity box. However, because formtastic pust each input in it's own LI element, I can't get them to appear next to each other.
Any ideas...
I'm looking for a way to override the Formtastic plug-in in rails so that times are shown as a single drop-down with minutes represented in half hour increments. Instead of the two drop-downs one for hour and one for minutes.
Ex 1:00 AM, 1:30 AM, 2:00 AM, etc?
any help would be appreciated.
...
I searched and tried a lot, but I can't accomplish it as I want.. so here's my problem.
class Moving < ActiveRecord::Base
has_many :movingresources, :dependent => :destroy
has_many :resources, :through => :movingresources
end
class Movingresource < ActiveRecord::Base
belongs_to :moving
belongs_to :resource
end
class Resource <...