similar to: Scaffold with Foreign Key fields possible?

Displaying 20 results from an estimated 30000 matches similar to: "Scaffold with Foreign Key fields possible?"

2006 Jan 13
4
missing foreign key fields in scaffold views
Is there any reason that foreign key fields do not show in any of the scaffold views ? project table: id serial primary key, category_id integer, user_id integer, name varchar, morestuff varchar foreign key (category_id) references categories(id), foreign key (user_id) references users(id) scaffold generated views only show name, morestuff fields
2006 Mar 15
10
Scaffold with Foreign Key
I have two tables: ------------------------------ drop table if exists users; create table users ( id int not null auto_increment, username varchar(100) not null, password varchar(20) not null, firstname varchar(20) not null, lastname varchar(20) not null, primary key (id) ) TYPE = InnoDB; ------------------------------ drop table
2006 Aug 11
5
Why does no one like render_component?
Maybe I''m missing the point? Lets take for example albums of pictures. If I have a scaffold for each, and I''m showing an album, what if I want to list all of the pictures that are in the album? Surely, I''d want to call the List action in the picture controller. render_component would do this perfectly. But we''re told not to use render_component. So
2007 May 27
3
Scaffold and foreign keys
Hello, I create a migration to add a foreign key ''page_id'' to a table ''main_sections''. After running the migration and adding the column, the scaffol that I have on the main_setions table does not add the foreign key into the CRUD. Any ideas why this is the case? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because
2006 Apr 05
13
scaffold misuse?
Running ruby script/generate scaffold Product Admin is a wonderful way to set up well, exactly what it says, a scaffold. My problem is that I have several other tables that are linked, through foreign keys, to the Product table. Say an "authors" table. Now when I go enter a new product, a book, I want the application to provide a drop down list of authors generated from the records in
2006 Mar 31
18
Modelling Foreign Keys
Can someone point me to a reference or tutorial that shows how to map foreign key relationships in the model? For example given: Users id name email Posts id user_id title How do I associate user_id with users.id in the Post and User models? has_many and belongs_to don''t seem to do it. -- Posted via http://www.ruby-forum.com/.
2006 Apr 04
2
Foreign keys not showing!
I''m new at this so please be patient. I have a very simple schema consisting of a around 10 tables in Postgresql. The aim is to provide a system for PC administrators to keep track of PC''s dotted around various venues (shops, libraries etc.). The sort of info I want to store is PC specs, PC network specs, PC ownership specs, PC location specs and contact person details. So I end
2006 Jul 26
4
can you pass data when you render :action
how can i do: render :action => "headline", :id => @user.id Thanks, Ben Lisbakken -- Posted via http://www.ruby-forum.com/.
2006 May 19
4
Lookup tables and scaffolding
It occurs to me as a missing feature that there''s no way to indicate a lookup table relationship (as opposed to other sorts of foreign key relationships) in Rails and that the scaffolding generator could recognise this lookup and render a drop-down list automagically for the lookup table. Say you have an Address and a State, and the State is a lookup table. In addresses you have
2005 Dec 17
3
Can scaffold generate listboxes in views? I''ve been unsuccessful.
I''ve created several different Rails applications but I''m running into the same trouble with each one. Lets say I create an app called Test. I type ''rails test'' and it generates the directory for me. Now I edit my database.yml file. Then I create a database with Postgresql by typing createdb test. Now I go into Postgresql by typing ''psql
2006 Mar 23
6
easy scaffold question(s)
I''m doing very well with the Hibbs Rolling on Rails tutorial. I have an easy question for my personal notes. I''m coming up with a simple framework of steps for creating a basic database. It includes the following maxims to make original app creation easy: app_name = MySQL database name SQL_tablename = model_name model_name = controller-name Is this going to work for getting
2009 Dec 10
2
How to customize the default scaffold?
I know the scaffold generator is really only useful for beginners and/or very the preliminary state of a project, but I find that I use it a lot (especially, since I am still a beginner). There are a couple of things I find myself tweaking (or wanting to tweak, but never getting around to tweaking) each time I generate a new scaffold: 1) Change the layout from blah.html.erb to
2006 Jun 07
2
script/generate scaffold pluralizes class names
Hi everyone, I''m a rails & ruby nuby, and this is my first post to the list. Here''s my environment in case it helps diagnose my problem: Ruby version 1.8.4 (powerpc-darwin8.6.0) RubyGems version 0.8.11 Rails version 1.1.2 Active Record version 1.14.2 Action Pack version 1.12.1 Action Web Service version 1.1.2 Action Mailer version 1.2.1 Active Support version 1.3.1 I did
2006 Jul 19
4
Using Application.rhtml as layout for all controllers
I put my nav system in application layout. that way any controller loading will have the nav system. I have one problem though - the <%= yield %> is in the body, so how would my controllers specify other css files? my application layout would look like this: <html> <head> title css include javascript include </head> <body> nav system <%=yield%>
2006 Mar 03
2
newbie scaffold question
I''ve got a database with several tables. I''d like to create scaffolding for separate CRUD interfaces for several of these tables. I''m hoping that the scaffold generator can create the CRUD code for all these tables in ONE controller, but I don''t know how to tell it to do that, if it can. Can anyone verify if this is possible? Thanks, David -- Posted via
2006 Jan 12
9
Scaffold shows all attributes altough I use attr_accessible!
Hi all I have a Model like this: class Member < ActiveRecord::Base attr_accessible :username, :email, :first_name, :last_name end I have created a scaffold using script/generate scaffold member members Using the URL localhost:3000/members/edit/1 I can edit all attributes, including created_at, lock_version etc.! But it should only show the attributes I listed in attr_accessible! What
2009 Jul 04
3
scaffolding
hi , i used the folllwing command to scaffold, G:\my\webblog>ruby script/generate scaffold webblog id:integer title:string body :text created_at:datetime after when i migrate with the follwing command rake db:migrate i got the error as (in G:/my/webblog) == 1 CreateWebblogs: migrating ================================================ -- create_table(:webblogs) rake aborted! Mysql::Error:
2006 Jul 18
3
Navigation techniques, everyone?
I''m rewriting the code to my first app. I want to reuse a lot of it, but tidy it up a lot. The first thing I will tackle is my nav-bar. Throughout a user''s experience on my app, I want it to reload as little as possible (I''ll have about 7 or 8 controllers with about 70 actions). So, I''ve thought of a few ways of doing it, and was wondering if you guys
2006 Jan 05
2
Rails Newb: Foreign Key Views?
I''m a total rails newbie, but I''m learning fast. I have a question that I can''t seem to find an answer for: What is the best way of coding views that represent foreign key relationships? For example, while developing, I''ve created an "articles" table. I create some scaffolding code and modify it all to look nice. I then realise, I need an
2005 Nov 30
2
Missing scaffold features
Hello everyone, First off, I''m trying to generate a discussion here, not provoke an argument or get people upset. Please bear this in mind if/as you read on... To my mind, there''s 3 missing features from scaffolds that would make them a whole lot more useful. These are: - auto-generation of a drop-down list for inputting/updating has_many/belongs_to relationships between