formotion
formotion copied to clipboard
form.render returning an empty hash
I'm seeing strange behaviour in my app.
When I call form.render
I get an empty hash {}
.
The exact same code loaded in another app works fine - so I'm starting to think it might be a clash with something else in my environment. Are there any known issues?
Here's my Gemfile:
source 'https://rubygems.org'
gem "motion-pixatefreestyle"
gem 'motion-yaml'
gem 'motion-testflight'
gem "motion-cocoapods"
gem "motion-persistable"
gem "bubble-wrap", require: false
gem 'formotion'
gem "motion-i18n"
gem "i18n_tools", :require => "i18n_tools/tasks"
gem 'rake', require: false
gem 'sass', '3.3.7', require: false
gem 'guard-sass', require: false
gem 'rb-fsevent', '~> 0.9', require: false
gem "cocoapods", require: false
group :spec do
gem 'guard', require: false
gem 'guard-motion', require: false
gem 'motion-redgreen'
gem 'motion-stump'
end
And my Rakefle
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/ios'
require 'motion-cocoapods'
require File.join(File.dirname(__FILE__), 'version')
begin
require 'bundler'
if ARGV.join(' ') =~ /spec/
Bundler.require :default, :spec
else
Bundler.require
end
rescue LoadError
end
require 'bubble-wrap/core'
require 'bubble-wrap/mail'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'MyApp'
app.device_family = [:ipad]
app.interface_orientations = [
:portrait_upside_down, :portrait, :landscape_left, :landscape_right]
app.frameworks += %w[ Accelerate AudioToolbox Social MessageUI]
app.weak_frameworks += %w[ AdSupport ]
app.pixatefreestyle.framework = 'vendor/Pods/PixateFreestyle/PixateFreestyle.framework'
app.sdk_version = '7.1'
app.deployment_target = '7.0'
app.fonts = font_paths
app.pods do
pod 'Mixpanel', "~> 2.4.0"
pod 'PixateFreestyle', '~> 2.1.3'
pod 'TestFlightSDK', '~> 3.0.2'
pod "ChimpKit"
end
if ARGV.join(' ') =~ /spec/
app.redgreen_style = :full # default: :focused
end
app.testflight do
app.testflight.app_token = # ...
app.testflight.api_token = # ...
app.testflight.team_token = # ...
app.testflight.notify = true # default is false
app.testflight.identify_testers = true # default is false
end
end
Hm no clue - you can copy the render code in your project and add some logging to see where it's going wrong?
I can't tell if this is a bug, but if you don't explicitly set a row's key when building the form, then regardless of its value, it's stripped from the final kv
array because the key is nil.
So, simply setting row.key in the builder fixes the issue. [I had the same issue. :)]
I have no idea what's wrong here - the problem goes away if I copy/paste row.rb into my own application.
I didn't change it in any way, I only copied it over.
Very weird.