Questions tagged [scaffolding]

Scaffolding is a meta-programming method of building database-backend software applications.

Scaffolding is a meta-programming method of building database-backend software applications. It is a technique supported by some model-view-controller frameworks (like Ruby on Rails, CodeIgniter, Spring Roo among many others) in which the programmer may write a specification that describes how the application database may be used. Some tool uses this specification to generate code to cover basic CRUD (Cread Read, Update, Delete) functionality, effectively treating the template as a scaffold on which to build a more powerful application. (View Wikipedia definition)

In many cases this scaffold can and has to be modified if we want to achieve more complex functionality and it's a reason why this feature is not recommended in complex sites.

Recently the term scaffolding has also been used for the use of pre-defined layouts or grids in CSS frameworks like Twitter-Bootstrap.

1070 questions
25
votes
17 answers

MVC4 Scaffolding Add Controller gives error "Unable to retrieve metadata..."

I'm using RTM version of Windows 8 and VS 2012 Ultimate. I have a MVC4 project using SqlCe 4.0 with a code first entity framework model. Model is very simple: public class MyThing { public int MyThingId { get; set; } public…
Jack Ukleja
  • 13,061
  • 11
  • 72
  • 113
24
votes
4 answers

Skip JSON format in rails generate scaffold

When you generate a rails scaffold using a command like rails g scaffold Thing is there any way to avoid getting that annoying respond_to do |format| format.html # index.html.erb format.json { render json: @things } end stuff in your…
mattangriffel
  • 819
  • 1
  • 7
  • 18
23
votes
6 answers

How to generate scaffold for data type with "extra description" in Rails 3?

From Ruby on Rails: best method of handling currency / money, how do you generate a scaffold for the folowing: add_column :items, :price, :decimal, :precision => 8, :scale => 2 Such as: rails generate scaffold LineItem name:string \ …
B Seven
  • 44,484
  • 66
  • 240
  • 385
23
votes
1 answer

Rails has_and_belongs_to_many & has_many :through scaffolding

Is there a way to generate a scaffold for Rails models that have either a has_and_belongs_to_many or has_many :through relationship? If not, is there a developmental reason why some basic form of this functionality has not been included? Rails…
Perry Horwich
  • 2,798
  • 3
  • 23
  • 51
23
votes
3 answers

rollback generated controller/model in RoR

I created, using the scaffolding, a model and controller files. Later I discovered it would be a good idea to create the tables in the DB first... My question, How can I role back the generated files and regenerate them now, that I have the tables…
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
19
votes
8 answers

VS 2013 Controller Scaffolding Fails for the ApplicationUser Model (Multiple object sets per type are not supported)

In a VS 2013 RTM, MVC 5 project with EF 6, I tried to scaffold a controller based on the ApplicationUser (default with individual accounts authentication). Both ApplicationUser and IdentityUser are mapped to a Users table. The wizard opens the…
AKhooli
  • 1,285
  • 1
  • 13
  • 11
19
votes
3 answers

Rails - Model name ends with S

I have a model named ActiveDns. When I run rails g scaffold_controller ActiveDns I get the message Plural version of the model detected, using singularized version. Override with --force-plural. Now, the controller and views are generated…
user684934
18
votes
3 answers

Re-Scaffold views after changing their model

I'm using Visual Studio 2013 and ASP.Net MVC 5. I've created a bunch of views for my models and then I've changed them. I want to run scaffolding on some models and create some views automatically and then change the automatically-generated views.…
Alireza Noori
  • 14,961
  • 30
  • 95
  • 179
16
votes
1 answer

Cabal to setup a new Haskell project?

Is it possible to (ab)use Cabal to have it create a generic Haskell project with a simple command, similar to what you can do in the Scala world with Sbt or Maven? e.g. > cabal create AwesomeProject > ls AwesomeProject.hs awesomeProject.cabal …
Alexander Battisti
  • 2,178
  • 2
  • 19
  • 24
15
votes
14 answers

Add Controller Model Classes not shown

I managed to create a Model First DBContext model (before it was a normal ObjectContext derived model). Strangly now my VS is not showing ANY of my classes in the Model selectlist in "Add Controller". More or less everything external is shown here -…
14
votes
1 answer

Rails 3.1 - changing default scaffold views and template

I'm using rails 3.1 with Zune Foundation templates and haml. I have tried to fiend ways to change the default scaffold view templates to use css I want so I get a consistent look with all scaffold without manually changing the view. I also use…
gugguson
  • 819
  • 2
  • 13
  • 32
14
votes
3 answers

npm global packages: Reference content files from package

I'm in the process of building an npm package which will be installed globally. Is it possible to have non-code files installed alongside code files that can be referenced from code files? For example, if my package includes someTextFile.txt and a…
Jacob Horbulyk
  • 2,366
  • 5
  • 22
  • 34
14
votes
2 answers

Where can I find the default Object.cshtml Editor template?

I need to modify the default editor template for scaffolding but I havent found the Object.cshtml template, where can I find the default razor Object.cshtml Editor template?
ryudice
  • 36,476
  • 32
  • 115
  • 163
13
votes
2 answers

Working with enums in ASP.NET MVC 3

Is there a clever way to get the MVC scaffolding to render a dropdown or listbox for model properties that are enum values? Example: public class MyModel { public Color MyColor { get; set; } public Option Options { get; set; } } public enum…
Jakob Gade
  • 12,319
  • 15
  • 70
  • 118
13
votes
1 answer

Quickest way to get Scaffold code created with C#/ASP.NET

At the start of any project, once you've got your object model there then comes a period of tedium as you crank out the skeleton code required. Are there any tools that will help me with this task (including unit test skeletons if possible), a bit…
Ben Aston
  • 53,718
  • 65
  • 205
  • 331
1
2
3
71 72