Questions tagged [scaffold]
429 questions
2
votes
3 answers
Flutter show SnackBar and return empty Container in StreamBuilder throws an Error
Hello I am trying to show Snackbar if network response return error right now My Build function looks like this:
@override
Widget build(BuildContext context) {
NewsBloc bloc = NewsBloc();
return Scaffold(
key: scaffoldKey,
…

Tornike Kurdadze
- 955
- 2
- 10
- 24
2
votes
0 answers
Array index error in Rails application, in the view, doesn't recognize the variable used as index
I'm working on a rails scaffold and I'm recording Working Hours in the database.
This is what I did in the controller:
[0,1,2,3,4,5,6].each do |day|
@biz.hours.build :day => day
end
I have defined the array in the application model:
class…

Raffaele
- 21
- 2
2
votes
1 answer
Rails api scaffold issue after setting activeadmin gem
I'm just starting to work with rails-api, and I wanted to implement some admin user interface for the backend side. As I'm used to activeadmin gem, I tried to use it here. I followed some steps to enable the middleware needed to run it, since it was…

Joel David Hernández Cruz
- 227
- 1
- 2
- 9
2
votes
2 answers
Why does passing BuildContext say there is no Scaffold in that Context?
import 'package:flutter/material.dart';
main() {
runApp(MaterialApp(
home: HomeScreen(),
));
}
class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new…

Raveesh Agarwal
- 168
- 1
- 8
2
votes
1 answer
EFCore scaffold
I am trying to create a Model, by using scaffold:
dotnet ef dbcontext scaffold "DataSource=database.sqlite" Microsoft.EntityFrameworkCore.Sqlite -o Model
But this return error:
Could not scaffold the foreign key 'PoolsInDepartments(pools_id)'. A…

Ruslan
- 33
- 5
2
votes
2 answers
Rails 3 scaffold and i18n
When scaffolding in Rails 3 the generator does this:
<% if @user.errors.any? %>
<%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:
-
<% @user.errors.full_messages.each…

jriff
- 1,947
- 3
- 23
- 33
2
votes
2 answers
How to Edit Rails Scaffold Model generator
I am trying to customise rails default scaffold generators. For views I can do that by simply adding files under : lib/templates/erb/scaffold/
Here I have added index.html.erb and customized, but I want to change model that is generated by this…

Nilay Singh
- 2,201
- 6
- 31
- 61
2
votes
2 answers
Generate scaffold or only model?
I want to make small cinema booking system as my school project and i think when i should generate only model? My database got:
tickets
seances
halls
customers
prices
genres
movies.
Im using activeadmin, so in example do i need to generate…

dfasofjoaishoiqw4e
- 77
- 1
- 8
2
votes
2 answers
Running rake db:setup removes all my users data
Within my ruby on rails application I have the seeds file, which contains data on the users such as:
User.create(:password => "jb", :password_confirmation => "jb", :role => 'admin', :first_name => "Joe", :last_name => "Bloggs", :house_no => "1",…
user4227507
2
votes
1 answer
Custom erb generator called from scaffold
I am looking to not only customise my erb scaffold templates but also to add new templates.
In ScaffoldGenerator < Erb::Generators::Base I can see there there is a way to provide additional templates in %w(index edit show new _form).
So I have…

Sash
- 4,448
- 1
- 17
- 31
2
votes
1 answer
Why does rails scaffold generator is simply ignoring my config/iniatilizers/inflections.rb?
I'm using Rails 3.2 with ruby 2.1
I put this code into my config/initializers/inflections.rb :
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular 'pub_type_contributeur', 'pub_types_contributeurs'
inflect.irregular…

Douglas
- 5,229
- 3
- 43
- 54
2
votes
1 answer
Rails 4 controller does not seem correct after scaffold
For training, I create a simple rails app.
Then
rails g scaffold Tache titre:string desc:text --skip-stylesheets
rake db:migrate
rails g bootstrap:install static
After that, I start the server, and I click on "Add Tache", I fill the 2 fields, and…

Shadow
- 23
- 2
2
votes
1 answer
error while generating nifty:scaffold=> create_migration': wrong number of arguments (3 for 0) (ArgumentError`)
While am trying to create a scaffold
rails g nifty:scaffold authentication user_id:integer provider:string uid:string index create destroy
authentication.rb was generated but no views
I am getting error…

user3710415
- 31
- 3
2
votes
1 answer
RoR - Scaffolding - unedfined method 'to_sym' for nil:NilClass only an error in the edit method
undefined method `to_sym' for nil:NilClass
I have this error only in my edit page of my nifty_scaffold.
This is _form.html.erb
<% form_for @progress do |f| %>
<%= f.error_messages %>
<%= f.label :date %>
<%= f.date_select…

NicoJuicy
- 3,435
- 4
- 40
- 66
2
votes
3 answers
dynamic_matchers.rb:55:in `method_missing': undefined method `migration_error=' for ActiveRecord::Base:Class (NoMethodError)
I'm on Windows. Ruby v.1.9.3p392 / Rails v. 3.2.13 - This is the demo_app project from the 2nd chapter of Michael Hart's Ruby on Rails Tutorial.
This error comes up when I issue 'rails generate scaffold User name:string email:string' Any idea how…

LilithX
- 137
- 1
- 2
- 10