Questions tagged [scaffold]

327 questions
294
votes
16 answers

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 main() => runApp(MyApp()); class MyApp extends…
Figen Güngör
  • 10,407
  • 11
  • 56
  • 101
62
votes
4 answers

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 me too much and I would rather code my…
Jason Yost
  • 4,647
  • 7
  • 39
  • 64
44
votes
6 answers

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?
Sean
  • 1,860
  • 3
  • 21
  • 32
30
votes
3 answers

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.
Ibrahim Muhammad
  • 2,628
  • 3
  • 27
  • 37
27
votes
4 answers

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?
jazzyfresh
  • 701
  • 1
  • 6
  • 11
26
votes
3 answers

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
Brett
  • 2,675
  • 4
  • 25
  • 32
26
votes
17 answers

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 scaffold Academy ../my-modules Because there is no such…
Andrius
  • 15,319
  • 31
  • 125
  • 205
26
votes
3 answers

How can I make scaffold only for controller and views if model already exists?

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. How can I make scaffold without affecting to User…
MKK
  • 2,663
  • 4
  • 28
  • 49
22
votes
3 answers

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:string email:string Afterwards I tried to run…
Hopscott
  • 251
  • 2
  • 6
21
votes
3 answers

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?
pupeno
  • 256,034
  • 114
  • 324
  • 541
15
votes
2 answers

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. I want to show background for full…
Ankur Prakash
  • 919
  • 1
  • 9
  • 22
14
votes
5 answers

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 those messages (one message -> many comments), I have…
Dan Rosenstark
  • 64,546
  • 54
  • 267
  • 405
13
votes
2 answers

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 stateful widget and change its state when the drawer…
Simiil
  • 2,196
  • 1
  • 20
  • 30
13
votes
2 answers

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.rb I have this: config.generators do |g| …
12
votes
1 answer

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 correspond to standalone tables; there's no use of…
Simon
  • 24,010
  • 36
  • 139
  • 249
1
2 3
21 22