Displaying 20 results from an estimated 1000 matches similar to: "Form Design issue - How to handle a parent association input.."
2011 May 03
0
Simple_Form and Simple_Fields_For and working in Form_Tag, Fields_For
I have this form and i got it working as i want:
<%= form_tag(update_individual_photos_path, :method => "put") do %>
<%= fields_for "photos[]", @photo do |f| %>
.................
<% end -%>
<%= submit_tag("Post") %>
<% end %>
But i would like to move to doing this with simple_form_for and
simple_fields_for but i cant get it
2011 Jul 25
1
3 models in a form.
Hello,
class Customer < ActiveRecord::Base
has_many :deliveries
class Delivery < ActiveRecord::Base
has_many :delivery_items
has_many :products, :through => :delivery_items
belongs_to :customer
class DeliveryItem < ActiveRecord::Base
belongs_to :delivery
belongs_to :product
I create a new delivery for customer x:
= simple_form_for @customer do |f|
= f.simple_fields_for
2011 Sep 01
0
do you think it's the best solution?
I have:
class Shop < ActiveRecord::Base
has_many :documents, :dependent => :restrict
has_many :roles, :dependent => :restrict
accepts_nested_attributes_for :documents
accepts_nested_attributes_for :roles
the shop _form is:
= simple_form_for(@shop) do |shop_f|
= render ''shared/error_messages'', :object => @shop
= render :partial =>
2012 Nov 29
2
[Rails 3.2] form_tag w :remote => true doesn't fire up the js format
I have a form_tag written like this :
= form_tag search_backoffice_places_path, {:remote =>"true", :id =>
:searchplaceForm } do
.. input fields
= submit_tag t(:search)
generated html is correct :
<form accept-charset="UTF-8" action="/en/backoffice/places/search"
data-remote="true" id="searchplaceForm" method="post">
...
2012 Feb 26
0
how to get the index of the element passed to the render view ?
I am displaying a collection of expenses in a form
the view in which the fom is displayed :
...
= simple_form_for(@project, :html => {:class => ''form-stacked'' })
do |f|
- unless @project.expenses.count > 0
No expenses
- else
#expenses
= f.fields_for :expenses do |f|
= render "backoffice/projects/expense_fields", :f
2012 Mar 26
3
render :json not sending any data back ...
[rails 3.2.2]
I perform an ajax call :
...
$.ajax
url: " /backoffice/expenses/rate"
type: "GET"
dataType: "json"
data:
project_id: $(''#project_id'').val()
code: $(this).val()
success: (result) ->
alert result
$(''#expense_price'').val(result)
in
2011 Feb 24
1
Rails 3 save parent model and association if nested attributes validation fails for uniqueness
Hi,
Song
has_and_belongs_to_many :people
accepts_nested_attributes_for :people
Person
validates :uniqueness => true
If person record not present, nested attributes working great! in rails way.
i.e., inserting into songs, people and people_songs table correctly.
I am interested in:-
*If there is person exist, it should skip insertion into people table but
data should be inserted in songs and
2012 Dec 04
2
[Rails 3.2] validation on create not working
class Place < ActiveRecord::Base
validates :description, :presence => true
validates :description, :uniqueness => {:case_sensitive => true, :on =>
:create }
# also tried
# validates :description, :uniqueness => {:case_sensitive => true }, :on
=> :create
On update ( in form fields, updated label, same description )
params
2019 Feb 15
0
32 seconds vs 72 minutes -- expected performance difference?
>
> That's interesting indeed. The verbose logs and network trace would tell
> us more.
>
I've enabled verbose/debug logging on the client side. Here are a few
operations from the log, and my observations on them:
1) Why is the log saying `SMB2` everywhere? Shouldn't it be saying `SMB3`?
2) Is this normal -- fs/cifs/smb2misc.c: Calculated size 157 length 156
mismatch mid
2012 Nov 02
1
[Rails 3.2.8] issue in regex scan
running a scan in irb is fine :
1.9.3p194 :001 > request_url =
"http://lvh.me::3000/en/backoffice/cms-admin/site/6/pages"
=> "http://lvh.me::3000/en/backoffice/cms-admin/site/6/pages"
request_url.scan(/^([\S]+)(backoffice\/cms-admin\/site\/)(\d+)(\/pages)$/)[0][2]
=> "6"
however running it in my controller doesn''t gives any result :
(rdb:1)
2012 Oct 21
1
load_missing_constant
I have a model ''site'' defined in a sub-folder ''cms''
class Cms::Site < ActiveRecord::Base
.....
the model is loaded correctly , checked in console:
application.rb
config.autoload_paths += Dir["#{config.root}/app/models/**/"]
console
>Cms::Site.all => []
Now trying to access this model from a sites_controller ( in
backoffice/cms
2010 Oct 07
1
Question on polymorphic association
I have 3 models . Doctor, Patient and User
with following associations
class Doctor < ActiveRecord::Base
has_many :patients, :dependent => :destroy
has_one :user, :as => :userable
accepts_nested_attributes_for :user
end
class Patient < ActiveRecord::Base
belongs_to :doctor
has_one :user, :as => :userable
accepts_nested_attributes_for :user
end
class User <
2005 Jul 12
0
nmbd registering itself als DMB is not working
Hello everybody,
i'm just setting up a samba server as pdc with ldap backend.
everything but netbios works fine.
The system is called aadmt00 and is a pdc (virtual) and is bound to the ip 192.168.53.180
hgest3201:~ # ip addr list
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255
2007 Oct 22
1
View spec response has no content?
I have been messing with this all night, and can''t figure out what''s going
wrong here. I have a test that renders the view, and then a shared
behavior checks "response" for the various tags from a rails layout. The
problem is matching. If I run in the browser the page renders
fine. Is there a way to output what the response contains? Here are my
tests:
describe
2013 Apr 15
0
mounting engine in namespace
I am testing an engine which normally is mounted at /
NotifyMe::Application.routes.draw do
> mount_opro_oauth :controllers => {:oauth_client_apps =>
> ''oauth/client_apps''}
I am trying to mount it inside my existing backoffice namespace, is it
possible or not advisable
namespace :backoffice do
> match ''/'', to:
2017 Dec 07
2
How to read or write Geolocation (RFC6442) data in SIP/PJSIP messages ?
Hello,
I'm having a look at section 13.1 from SIP Connect v2 doc (see [1]).
It refers to RFC6442 which gives the following example (sorry for its
length):
INVITE sips:bob at biloxi.example.com SIP/2.0
Via: SIPS/2.0/TLS pc33.atlanta.example.com;branch=z9hG4bK74bf9
Max-Forwards: 70
To: Bob <sips:bob at biloxi.example.com>
From: Alice <sips:alice at
2012 Nov 27
1
controller not rendering existing js.erb file
In my PlaceController, I have a search method, called remotely from a form
the method is executed, but rendering is not executed as the template is
stated as missing ..
but it''s there ...
post :search, :locale => I18n.locale, :format => :js, :country =>
"United"
Error: test_should_search_places(Backoffice::PlacesControllerTest)
ActionView::MissingTemplate:
2010 Dec 07
1
fields_for and one out of many from association
class Person < ActiveRecord::Base
has_many :addresses
has_one :primary_address, :class_name => ''Address'', :order =>
''preferred desc, id''
accepts_nested_attributes_for :addresses, :allow_destroy => true
accepts_nested_attributes_for :primary_address, :allow_destroy =>
true
end
class Address < ActiveRecord::Base
belongs_to :person
end
2009 Nov 24
0
Problem with association when getting a validation error on update
Quick overview:
2 classes-
class Building < ActiveRecord::Base
has_many :styles, :dependent => :destroy
validates_presence_of :address1
accepts_nested_attributes_for :styles, :allow_destroy => true
end
class Style < ActiveRecord::Base
belongs_to :building
end
The sequence of my problem is as follows:
- Edit building view and retrieve is different styles (so I can
2013 Jan 04
0
Add data in between Simple Form association members
Hey there,
I am trying to use Simple Form''s association to list a bunch of radio
buttons like so:
<%= simple_form_for(@applicant) do |f| %>
<%= f.association :track, :as => :radio_buttons %>
<% end %>
Assuming each track has many courses, how can I take every track from that
association and loop over its courses to display them below the radio