Displaying 7 results from an estimated 7 matches for "place_id".
Did you mean:
place_
2006 Jul 04
1
select(object, method, choices, options = {}, html_options = {})
...=> nil to leave all
options unselected."
But this is not working to me. Is it for anybody?
First I think post.person_id is @post.person_id. Anyway it doesn''t put
the selected property. Even forcing a :selected => value this way:
<%= select(''night'', ''place_id'' , Place.find_all.collect {|p| [ p.name,
p.id ] },{:selected => @night.place_id}) %>
doesn''t work.
Thanks,
Enrico
--
"The only thing necessary for the triumph of evil
is for good men to do nothing"
Edmund Burke
2012 Oct 13
4
Database design, working but looking for better ways
Rails 3.1.3
Hi. I have designed the database used for my travel plan application.
You should be able to look at the diagram in the link below, hopefully.
https://cacoo.com/diagrams/biDSyxh8yzk2kIeg
("belongs_to" is omitted since it''s obvious)
Basically, the application can list the destinations from a choice of
the departure.
Not mention that the departure_id (integer) and
2007 Jun 29
1
Speeding up :dependent => :destroy
I have a tree of models that represent a book. Looks like this:
book
sections
documents
paragraphs
index entries
glossary entries
footnotes
index entries
glossary entries
These are all models with has_many from parent and the child has
belongs_to. They also all have dependent => :destroy
2006 Mar 24
4
habtm: attribute on join table
How do I retrieve the value of an attribute on my join table? For
example:
table ''people_places''
person_id
place_id
disposition
The first two use foreign keys and all that (I get that part). The value
of ''disposition'' is what I want.
--
Posted via http://www.ruby-forum.com/.
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">
...
2011 Oct 25
7
additional model attributes
...attr_accessor but that didn''t work either.
any hints?
thanks
==========================================
place.rb
class Place < ActiveRecord::Base
attr_accessor: address
end
==========================================
places_controller.rb
external_api_place_data = @client.find(place_id)
place = Place.new
place.name = place.name
place.id = place.id
//not showing up in the json result
place.address = external_api_place_data.address
places = []
places << place
respond_to do |format|
format.html # index.html.erb
format.json { render json: places }
e...
2008 Nov 13
0
RESTful acts_as_tree
...in a RESTful way? I don''t necessarily care about have an url /
place/id/place/id. I''m mostly interested to know the correct way of
passing the parent_id in order to create the new place.
This is my create method:
# POST /places
def create
@parent_place = Place.find(params[:place_id])
# or do I use @parent_place = Place.find(params[:parent_id])
@place = @parent_place.children.build(params[:place])
respond_to do |format|
if @place.save
flash[:notice] = ''Place was successfully created.''
format.html { redirect_to(@place) }...