Displaying 6 results from an estimated 6 matches for "gallery_id".
Did you mean:
gallery_ids
2006 Jun 08
5
update only the join table in a HABTM - how?
...tographers app that requires giving access to galleries for
users. in one part, I want to be able to define gallery access for a
user seperate from updating any of the user info. I have this function:
def edit_access
@user = User.find(params[:id])
@user.galleries = Gallery.find(params[:gallery_ids]) if
params[:gallery_ids]
if @user.update_attributes(params[:user])
flash[:notice] = ''Account was successfully updated.''
redirect_to :action => ''list''
else
@galleries = Gallery.find(:all)
render :action => ''manage_...
2006 May 11
4
modelling data to specify user access
Hello, this is my second Rails app, and the first one I did had simple
data mapping. This time I am building a site for a photographer, and
they want to upload photos, and create galleries that only certain
clients can log in and have access to. There will be multiple
galleries, and the access to them will vary depending on how the admin
assigns it to each client. There is also a porftolio
2005 Dec 23
4
OO model style: inheritance
...cr` text NOT NULL,
PRIMARY KEY (`id`),
KEY `user_key` (`user_id`),
KEY `node_key` (`node_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `images`;
CREATE TABLE `images` (
`id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL default ''0'',
`gallery_id` int(11) NOT NULL default ''0'',
`node_id` int(11) NOT NULL default ''0'',
`title` varchar(255) NOT NULL default '''',
`descr` text NOT NULL,
PRIMARY KEY (`id`),
KEY `gallery_key` (`gallery_id`),
KEY `node_key` (`node_id`),
KEY `user_ke...
2008 Jan 10
0
BUG? has_many :through makes funny queries
...r < ActiveRecord::Base
has_one :gallery, :as => :owner, :dependent => :destroy
has_many :folders, :through => :gallery
Seems fine, right? So @user.folders should do join between users,
galleries and folders.
users.id (1 in the example) == gallery.owner_id and gallery.id ==
folders.gallery_id
Right? Well it does not.
Mysql::Error: #42S22Unknown column ''galleries.gallery_id'' in ''on
clause'': SELECT folders.* FROM folders INNER JOIN galleries ON
folders.id = galleries.gallery_id WHERE ((galleries.owner_id = 1) AND
(galleries.owner_type = ''...
2012 Jul 18
0
Rails 3.1 Optional Routes
Hi all,
I am using Rails 3.1 and Ruby 1.9.2
In my application i am using optional routes like below
match ''Gallery(/:gallery_id(/:image_id))(/page/:g_page)'' => "wps/
gallery#show_gallery_page",:as => :gallery_page
in console i am trying to call the routes like below
include Rails.application.routes.url_helpers
=> Object
1.9.3dev :002 > gallery_page_path
=> "/Gallery"
1.9.3dev...
2006 Dec 14
12
Saving dates
Hi having trouble saving dates in my form i have the following in the
view
<%= date_select("details", "open_date") %>
and i have
@exhibition.open_date = params[:details][:open_date]
and then
@exhibition.save
All the other values form (not seen here) get saved but not the dates.
What am i doing wrong ?
--
Posted via http://www.ruby-forum.com/.