Questions tagged [scaffold]
The scaffold tag has no usage guidance.
scaffold
448
questions
363
votes
16
answers
155k
views
Scaffold.of() called with a context that does not contain a Scaffold
As you can see, my button is inside the Scaffold's body. But I get this exception:
Scaffold.of() called with a context that does not contain a Scaffold.
import 'package:flutter/material.dart';
void ...
69
votes
4
answers
104k
views
Ruby on Rails Generating Views
Is there a way to generate the views separately using the rails generate command? I would also be willing to install a gem to accomplish that task f one exists. Basically the scaffolding command gives ...
50
votes
6
answers
28k
views
Create Ruby on Rails views (only) after controllers and models are already created
I've obtained a project that have controllers (minimal code only) and models, but the views are missing. Is there a way to generate the views only using scaffold or another tool?
33
votes
12
answers
13k
views
How to fix black screen in flutter while Navigating?
I am creating a multi-paged app on flutter. When I am using the navigation in it, I am getting a black screen.
import 'package:flutter/material.dart';
void main() => runApp(MyHomePage(...
32
votes
3
answers
15k
views
Is there a way to generate a rails scaffold without the views?
Is there a way to generate a rails scaffold without the views, there has to be a better way then generating the scaffold and deleting the views and the view specs.
31
votes
3
answers
53k
views
Background Image for Scaffold
I want to set the image as the background color for Scaffold. When setting an AppBar and bottom bar, using the decoration of the Container as the body of the scaffold doesn't cover the complete screen....
31
votes
4
answers
13k
views
difference between scaffold and model in Rails
What's the difference between generating a scaffold and generating a model in Rails? What are the advantages/disadvantages of doing either?
31
votes
2
answers
7k
views
Should I use Scaffold in every screen ? what are best practices while using topBar, bottomBar, drawer, etc. in compose
I am writing an android application pure in compose and I am using scaffold in every screen to implement topBar, bottomBar, fab, etc.
My question is should I be using scaffold in every screen or just ...
29
votes
19
answers
23k
views
Odoo - scaffolding?
I read here that you can scaffold a module using a command, so you won't need to manually create some initial files. But such command does not work on master (on Odoo development branch):
./oe ...
28
votes
3
answers
39k
views
How can I make scaffold only for controller and views if model already exists? [duplicate]
I already have set up Devise to My App.
So User model is already generated, and exists by installing Devise
Now I'd like to add my own controller users_controller.rb and its views index and show.
...
27
votes
3
answers
15k
views
Rails scaffold without the css file?
Is there a way to generate a scaffold in rails 3.0 so that scaffold.css does NOT get created? Something at the command line I can enter to skip that step?
Thanks
25
votes
4
answers
16k
views
Can generate scaffold put the controller in a namespace?
I want to generate the scaffold in a Rails app, generating the model as usual but having the controller inside the admin namespace. Is it possible?
22
votes
3
answers
6k
views
Can't migrate database after scaffold. Section 2.2 Ruby on Rails Tutorial Michael Hartl
I'm working through the Hartl ruby on rails tutorial (section 2.2), and I'm having trouble migrating the database. Everything seemed to be working, and then I ran rails generate scaffold User name:...
15
votes
3
answers
5k
views
Skip jbuilder files when I generate a scaffold?
When I scaffold I don't want it to generate these files:
invoke jbuilder
create app/views/tests/index.json.jbuilder
create app/views/tests/show.json.jbuilder
But how? in my application....
14
votes
5
answers
16k
views
Rails: Scaffold to automatically do one-to-many relationship
Not sure if I'm reading this right, but it seems like Scaffold will not do a one-to-many relationship in its entirety. For instance, if I create messages with scaffold and then I want comments on ...
13
votes
2
answers
6k
views
Flutter Navigation Drawer that actually navigates
I have a simple Scaffold with a drawer and a body. I want to select an item in the drawer and have the scaffold's body navigate to a new view.
Most approaches that i found (like this) just use a ...
12
votes
2
answers
10k
views
rails g scaffold for existing model and DB table
I would like to create a structure with
rails g scaffold Article, but I have already created the table Articles and model Articles.
Is there any way to do that?
12
votes
1
answer
12k
views
How do I create many-one relationships using Scaffold?
I'm new to Ruby on Rails, and I'm trying to create a bass guitar tutor in order to teach myself RoR (and bass guitar). The walkthroughs use Scaffold to create ActiveRecord classes, but they seem to ...
11
votes
3
answers
3k
views
How to have the scaffold to generate another partial view template file
I'm trying to customize my scaffold generator, and I would like to have a new partial for the view in the same directory, in particular _item to be called both inside index and show. I can get all the ...
10
votes
3
answers
24k
views
Exception has been thrown by the target of an invocation thrown when scaffolding a controller
I created a separate Class Library project to store the Database Context and Model Classes.
In the same solution, I created an ASP.NET MVC project and referenced the Class Library project, as well as ...
9
votes
4
answers
18k
views
How to hide drawer in flutter after changing Scaffold.body value
I am using the method in this question to change the body of a Scaffold in flutter:
Flutter Drawer Widget - change Scaffold.body content
The method described works perfectly. Now I would like just ...
9
votes
5
answers
21k
views
How to change routes in ruby on rails?
I just installed Ruby on Rails and created a scaffold called posts. RoR generated controllers and other required files for me.
I created a new method in posts_controller, but I can't access it. I ...
8
votes
2
answers
13k
views
Need to create a foreign key when creating a table on Rails?
i'm starting now on Rails, i looked in the forum, but i didn't find anything that could solve my problem.
Here it goes, I have a Category table, and it has only name for a column (there is no ...
8
votes
3
answers
4k
views
Scrollable.of() was called with a context that does not contain a Scrollable widget
I/flutter ( 5136): Another exception was thrown: Scrollable.of() was called with a context that does not contain a Scrollable widget.
I/flutter ( 5136): Another exception was thrown: A RenderFlex ...
8
votes
2
answers
6k
views
Is it correct to have nested Scaffold in Flutter? [closed]
I have a PageView in my app homepage and I want:
The AppBar changes according to the page
The BottomAppBar is fixed
The 2 solutions I imagined are:
The hard one: have one Scaffold with appBar, body ...
8
votes
3
answers
6k
views
Can I dock a floating action button in a CupertinoTabBar?
I would like to know if there is a way to dock a floating action button in a CupertinoTabBar. I would like to get the results as in the picture below
My screen is organized as follow
...
8
votes
1
answer
2k
views
How to change topBar corresponding screen in Jetpack Compose
I have a Scaffold like this:
Scaffold(
topBar = {
TopBar(...)
},
bottomBar = {
BottomNavigationBar(...)
}
) {
NavHost(...)
}
What is the best way to change TopBar when I ...
8
votes
2
answers
4k
views
How to prevent a jetpack compose scaffold from taking the whole height of the screen when it is shown in a dialog
I am having an android activity which has Base.Theme.AppCompat.Light.Dialog as a theme on tablets and therefore is shown in a dialog.
When I used XML layouts I could set a min height with wrap content ...
7
votes
3
answers
5k
views
Rails 3 => Undefined method 'array' when I try to rake db:migrate
This is my first post here so go easy. I am trying to build my first app in Rails 3.2.1. I am trying to generate a scaffold for Paint using the following terminal command:
rails generate scaffold ...
6
votes
4
answers
4k
views
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
...
6
votes
2
answers
3k
views
Android Jetpack Compose - Floating Action Button of custom image
I write this code.
Image (
painter = painterResource(id = R.drawable.image),
contentDescription = "fab",
modifier = Modifier
.size(80.dp)
....
6
votes
3
answers
5k
views
adding extra attribute to a rails command
While trying to generate a new scaffold using - collection> rails generate scaffold Items name:string subcategory_id:integer users_id:integer, i missed out the 'users_id:integer' and ...
6
votes
1
answer
3k
views
In Flutter, how do you set *all* the scaffold background color at once?
Currently, I set background color of each screen using this:
@override
Widget build(BuildContext context) => Scaffold(
backgroundColor: Colors.white,
body: ...
);
Every time I create ...
6
votes
1
answer
1k
views
Ruby/Rails: where is the code to generate scaffolds
I was browsing the code at github.com/rails/rails, and I couldn't figure out where the code was to generate Rails scaffolds. Can anybody shed some light on this?
6
votes
1
answer
2k
views
Define Scaffolding. (with respect to Dynamic Data and ASP.NET MVC)
There is a lot of information about how to implement and customize scaffolding with Dynamic Data and ASP.NET MVC. What exactly is the definition of scaffolding when used in this context?
6
votes
2
answers
391
views
Grails scaffold 404 with byte[]
I'm trying to upload a file in grails. The generated scaffold is not working for me and giving me a 404 looking for 'save.jsp'
Domain
class Simple{
byte [] avatar
static constraints = {
...
5
votes
6
answers
36k
views
ASP.NET MVC 5 Model-Binding Edit View
I cannot come up with a solution to a problem that's best described verbally and with a little code. I am using VS 2013, MVC 5, and EF6 code-first; I am also using the MvcControllerWithContext ...
5
votes
2
answers
6k
views
InheritedWidget with Scaffold as child doesn't seem to be working
I was hoping to use InheritedWidget at the root level of my Flutter application to ensure that an authenticated user's details are available to all child widgets. Essentially making the Scaffold the ...
5
votes
1
answer
11k
views
I am trying to set a background image in Android using jetpack compose but the image cant fill the whole page
i want to fill the image to max size of page and fill the edges below the appbar.
i can fill the image to full background without using scaffold but in this case i need to use scaffold.
the screenshot ...
5
votes
3
answers
25k
views
How to add multiple Children to flutter scaffold body
I am trying to write multiple child to flutter scaffold body: tag.
I am new to flutter and I don't know how to do multiple children inside a body tag.
his is what I have tried.
return new Scaffold(
...
5
votes
1
answer
2k
views
Ruby on Rails: Get next item in model
Say I have simply ran rails g scaffold book name:string about:text On the 'show' view, how would I implement a button to go to the next item in the model.
I can't simply do @next = @book.id + 1 ...
5
votes
1
answer
20k
views
Elevation not working on flutter material
I want to do an app that looks like this with that slice on the corner. I can make that slide but my app doesn't have that shadow.
I have my front layer wraped inside a material wideget with ...
5
votes
2
answers
1k
views
Is it possible to scaffold multiple controllers in one command?
Using MvcScaffolding I can call these powershell commands to scaffold the Controllers and Views automagically.
scaffold Controller Products
scaffold Controller Reviews
Is it possible to combine the ...
5
votes
1
answer
3k
views
Adding image to scaffold top bar in jetpack compose
I'm trying to add an image from a database to my top bar but it shows up as a white filled in rectangle - the image doesn't show at all. here's the below code. the way I have the icon set up works ...
5
votes
1
answer
2k
views
Display a domain transient property in scaffolded views
In my Grails 1.3.7 project I have a domain class like this:
class User {
String login
String password
String name
String passwordConfirmation
static constraints = {
login unique:true, ...
5
votes
3
answers
3k
views
Passing a value to the floating action button to be used in the bottom sheet
In this widget the tabs navigate between types if it is question it goes a specified screen. If it is forum it goes to another one. The problem is I need to pass the type of the current tap to the on ...
5
votes
2
answers
3k
views
replace <f:all /> tag with normal fields on custom template grails
i install templates in grails 3 and files are in src/main/templates/scaffoldind works fine but use tag
<f:all bean="${propertyName}"/>
I need a bootsrap twitter class on all inputs and f:all ...
4
votes
2
answers
3k
views
jetpack compose Scaffold Possible to override the standard durations of SnackBar?
How can override the standard durations of the Scaffold SnackBar to apply my own durations in MS. I can't see a way to do it
is EventsToAddAlbumScreen.ShowSnackbarEventToAddAlbumScreen -> ...
4
votes
2
answers
3k
views
Rails 3 Inflection Problem
I'm having a problem with generating scaffold for a Regatta. When I run
rails g scaffold Regatta name:string start_date:datetime
I get a model named regattum and a controller called ...
4
votes
1
answer
4k
views
Rails: after using scaffold, I can't migrate
[rails 4.1.6, ruby 2.1.3p242 ]
1.set the database.yml database: bookshop , and created the bookshop database in my database.
2.create a new table books with id int(10), name varchar(45) by SQL( I ...