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
6
votes
3 answers

Where can I find documentation on MvcScaffold package listed on nuPack?

I'm trying to find documentation on how to use the MvcScaffold package on nuPack, but I can't find anything anywhere. I know I have basic intellisense support in the Package Management Console, but I want to do something a little more complicated…
Joseph
  • 25,330
  • 8
  • 76
  • 125
6
votes
4 answers

Changing scaffold-controller-generator-templates in Rails

When I use the Rails scaffold generator to create my Rails-files, it creates among others a controller file. e.g. rails generate scaffold potato generates: app/controllers/potatos_controller.rb For my project I want this file a little more specific.…
Michael B
  • 1,660
  • 3
  • 28
  • 59
6
votes
1 answer

Templating Html.DisplayFor() in ASP.NET MVC 2

It appears that if you just use Html.DisplayFor(model => model) with no templates for a Details view, the resulting markup will look something like this:
first name
Dan
devuxer
  • 41,681
  • 47
  • 180
  • 292
6
votes
1 answer

Robust billing system design. Am I going completely in the wrong direction?

I am developing a hotel registration/billing application in ASP.Net, using the entity framework. When it comes to generating the bill for the registrant, my client has a lot of wacky criteria. Instead of a per bed per night (pretty standard..)…
6
votes
4 answers

rails: create scaffold for models to inherit from superclass?

I'm new to Rails, still getting my feet wet, so please pardon me if this is either trivial or "the wrong way" to do things. I'd like to create a superclass for some scaffolded models. For example, I'd like to create a scaffold for Men and for…
allanberry
  • 7,325
  • 6
  • 42
  • 71
6
votes
1 answer

scaffold template use cshtml

When I generate my controller and views with the below command scaffold controller -force -repository -DbContextType "XXX" -Area YYY It generates .aspx (web form) pages instead of .cshtml (razor) How can I change this default behaviour. I…
Daveo
  • 19,018
  • 10
  • 48
  • 71
6
votes
3 answers

How to edit multiple models in one form?

I got a task from my trainer. I want to edit two models in one form. For example, we have two entities student and address. In the new student part i want to add both student details and address. How can i achieve this through scaffolding in ruby…
Nithin Viswanathan
  • 3,245
  • 7
  • 39
  • 84
6
votes
3 answers

Rails scaffolds scss reset each time a scaffold is generated

Each time I do a rails generate scaffold Name, the app/assets/stylesheets/scaffolds.css.scss file is overwritten (well I get prompted to overwrite it). I don't want this, so of course I could just type n when prompted to overwrite, but I want to…
at.
  • 50,922
  • 104
  • 292
  • 461
5
votes
3 answers

Rendering a form from another controller in Ruby on Rails 3

Ok, the problem is trying to render a form from a controller to create a new entry.. For that im calling the default form that comes with the scaffold creation I'm trying to make it like this: <%= render :partial => 'contactos/form' %> And im…
5
votes
1 answer

Can I force Entity Framework Core 7 to not make ICollections read-only?

Entity Framework Core 7 introduced a breaking change (although it is not listed in the breaking changes for EF Core 7): when defining model classes with scaffolding (Scaffold-DbContext), EF Core 7 now makes the ICollection properties read-only. EF 6…
5
votes
2 answers

Entity framework Core - Scaffolding enum

Context: I use Database-first approach to generate my entities with Entity Framework Core and with use of Scaffolding. Each time I change something in the database I run Scaffolding with -f parameter to rewrite generated entities. So far so good. In…
Kebechet
  • 1,461
  • 15
  • 31
5
votes
2 answers

ASP.NET MVC 3 and NHibernate Scaffolding

I found this article [http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/], which explains how to use MVC Scaffolding with one-to-many relationships in EF to create a listbox with an…
Darbio
  • 11,286
  • 12
  • 60
  • 100
5
votes
2 answers

How to run migration after scaffolding database

I have a .NET Core project using EF Core. We already had some tables in the database, so I used EF Core scaffolding command to import all tables into my application. Everything went fine, I have the models built and I can use those to access…
5
votes
1 answer

New language feature breaks scaffolding - Could not get the reflection type for DbContext

So new language features implements the option to shorthand the default keyword. public void GenericMethod(T responseObject = default) { //Your code here } Instead of the old public void GenericMethod(T responseObject = default(T)) { …
Saveyy
  • 75
  • 5
5
votes
1 answer

ASP.NET Core : Generate Razor Pages for all models

I have created a ASP.NET Core 2.1 project With "Database first" approach and Razor Pages (no MVC). All my models are generated from the database context. I successfully created CRUD Razor Pages for one of my models with a command line like this one…
Jeremy
  • 75
  • 1
  • 3