query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
12aadcd280535540887ab54d7e7f0a77
Arguments changed from camelCase to snake_case in GraphQL v1.10, and GraphQL::Schema.from_definition does not allow changing this default. This normalizes all arguments into HashWithIndifferentAccess structures with (optionally) camelized keys for backwards compatibility with existing apps.
[ { "docid": "e97754b289a4497fe86812d7686e72b4", "score": "0.6779208", "text": "def format_args(args)\n input = args.to_h.transform_values do |value|\n next value.to_h if value.is_a?(GraphQL::Schema::InputObject)\n next value.map { |v| v.is_a?(GraphQL::Schema::InputObject) ? v.to_h : v } if value.is_a?(Array)\n value\n end\n\n if GraphQLServer.config.camelize_arguments\n input = input.deep_transform_keys! { |key| key.to_s.camelize(:lower) }\n end\n\n input.with_indifferent_access\n end", "title": "" } ]
[ { "docid": "3ba06f870e8b1959e04f114a554758f1", "score": "0.6000669", "text": "def normalize(hash)\n hash.symbolize_keys if hash\n end", "title": "" }, { "docid": "960eb4cb92a5236ad6cb3b3c7f214ad7", "score": "0.58467156", "text": "def normalize_args(string, options_hash); end", "title": "" }, { "docid": "287109dc603a21ee01c128729bffb79d", "score": "0.58147657", "text": "def normalize_keys\n transform_keys { |key| key.downcase.to_sym rescue key }\n end", "title": "" }, { "docid": "a408c7d355c51a3768b078a20b10b158", "score": "0.57823247", "text": "def normalize\n @parameters.inject({}) do |hash, (k, v)|\n v = v.is_a?(Array) ? v.join(',') : v.to_s\n k = k.to_s.split('_').map {|w| w[0, 1] = w[0, 1].upcase; w }.join\n hash[k] = v\n\n hash\n end\n end", "title": "" }, { "docid": "e4ffc7a03e1d261e5a536756941d5cfb", "score": "0.5719068", "text": "def transform_params(params)\n case @case\n when 'snake', 'as_is'\n params\n when 'camel'\n snakecase_keys(params)\n else\n raise Blacksheep::Error, \"unknown_case #{@case}\"\n end\n end", "title": "" }, { "docid": "6d32eb70569d75a00f7edeaf4ef1dade", "score": "0.57169634", "text": "def transform_parameters(params)\n Smash.new.tap do |new_hash|\n (params || []).each do |key, value|\n new_hash[snakecase(key)] = value\n end\n end\n end", "title": "" }, { "docid": "2452c48612c5707f5fd4c7feae99b77a", "score": "0.5709373", "text": "def transform_param_keys_casing\n params.transform_keys!(&:underscore)\n end", "title": "" }, { "docid": "71e9e8cf982c4992a02dbf3bc4d5ea52", "score": "0.5694198", "text": "def normalize_keys(hash)\n hash.each{|k, v|\n hash.delete(k) unless @@valid_types.include?(v.class)\n if k.is_a?(String)\n hash.delete(k)\n hash[k.gsub(/\\-/, \"_\").to_sym] = v\n elsif !k.is_a?(Symbol) # elsunless\n hash.delete(k)\n end\n }\n return hash\nend", "title": "" }, { "docid": "d82da4f36bd5b482cfa1680dd962b372", "score": "0.56898755", "text": "def normalize_parameters(parameters={})\n # Convert keys to Strings when appropriate\n if parameters.kind_of?(Hash) || parameters.kind_of?(Array)\n # Returning an array since parameters can be repeated (ie, Adsense Management API)\n parameters = parameters.inject([]) do |accu, (k, v)|\n k = k.to_s if k.kind_of?(Symbol)\n k = k.to_str if k.respond_to?(:to_str)\n unless k.kind_of?(String)\n raise TypeError, \"Expected String, got #{k.class}.\"\n end\n accu << [k, v]\n accu\n end\n else\n raise TypeError,\n \"Expected Hash or Array, got #{parameters.class}.\"\n end\n return parameters\n end", "title": "" }, { "docid": "6f9b8386200f87adb20eb8a3631cae22", "score": "0.568917", "text": "def standardize_opts(opts)\n opts ||= {}\n opts[:mode] = :rails\n opts[:symbol_keys] = opts[:symbolize_keys] || opts[:symbolize_names]\n\n opts\n end", "title": "" }, { "docid": "ffc72b53abb083eb17680bec77543b45", "score": "0.56782424", "text": "def normalize_options(options)\n options.to_sym_keys\n end", "title": "" }, { "docid": "ff6eb0c39a9a779e849befcba0d96a18", "score": "0.5666521", "text": "def normalized_hash\n normalize! unless @normalized\n hashify(:normalized)\n end", "title": "" }, { "docid": "c642a33e73c6b8eb6dca4d9bb032b808", "score": "0.56397426", "text": "def sanitize_params(inputs)\n out = {}.with_indifferent_access\n _fields.each_pair do |field, config|\n next unless inputs.key?(field)\n\n begin\n out[field] = ::Subroutine::TypeCaster.cast(inputs[field], config)\n rescue ::Subroutine::TypeCaster::TypeCastError => e\n raise ::Subroutine::TypeCaster::TypeCastError, \"Error for field `#{field}`: #{e}\"\n end\n end\n\n out\n end", "title": "" }, { "docid": "e749472bb409fbd86cde574c85b64d7f", "score": "0.5639205", "text": "def transform_params\n params.transform_keys! { |key| key.underscore }\n end", "title": "" }, { "docid": "b68f7f6a14e567ad42c8d8a883366857", "score": "0.56181794", "text": "def _normalize_options! opts, new_opts = { }\n opts.each do | k, v |\n new_opts[k.to_sym] = v\n end\n \n new_opts\n end", "title": "" }, { "docid": "ef4dc71e0ef20a6003923069369ce6d6", "score": "0.5569489", "text": "def process_options(raw, options = {})\n raw = raw.merge(options)\n \n # normalize all keys to lowercase\n new_hash = {}\n raw.each {|k, v| new_hash.merge!({k.downcase => v})}\n \n # filter out type -> it is only meaningful to opennebula\n new_hash.delete(:type)\n\n new_hash\n end", "title": "" }, { "docid": "bd31bd0be460ce2b991a7acef62b7fd6", "score": "0.5565957", "text": "def deep_camelize_keys\n deep_transform_keys { |key| key.to_s.camelize(:lower) }\n end", "title": "" }, { "docid": "50f2e68ec1213f1b996d833523b7f537", "score": "0.55405277", "text": "def clean\n @schema = Hash[@schema.map { |key, value| [key.downcase.to_sym, value] }]\n end", "title": "" }, { "docid": "efa5535610b87b193843d617b385337a", "score": "0.5526055", "text": "def camelize_and_normalize_name(snake_cased_name)\n result = Client.camelize_name(snake_cased_name.to_s)\n PARAM_NORMALIZATION.each {|k, v| result.gsub!(/#{k}/, v) }\n result\n end", "title": "" }, { "docid": "4e33712d8e727886346597e59486c262", "score": "0.5517908", "text": "def serializable_hash(options)\n original_hash = super(options)\n Hash[original_hash.map {|k, v| [self.aliased_fields.invert[k] || k , v] }]\n end", "title": "" }, { "docid": "88ce44c4112044f529d7e7d6aa1997da", "score": "0.5515021", "text": "def to_normal_hash(hash)\n hash.to_h.transform_keys(&:to_sym)\n end", "title": "" }, { "docid": "1e9d9a92fbfea95d339593e590d6a392", "score": "0.54813445", "text": "def to_input_hash\n Types::Coercible::Hash.schema(\n map { |attr| [attr.name, attr] }.to_h\n )\n end", "title": "" }, { "docid": "ba677c80d280d99e3c00dbe4a37f5ed0", "score": "0.54582655", "text": "def key_coercions=(_arg0); end", "title": "" }, { "docid": "05b1256f208d478f02db8dc564a757a3", "score": "0.54267985", "text": "def symbolize_keys!\n transform_keys!{ |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "05b1256f208d478f02db8dc564a757a3", "score": "0.54267985", "text": "def symbolize_keys!\n transform_keys!{ |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "41ebddf31be1559cfa07da6e2b9905e3", "score": "0.54208976", "text": "def sanitize_params(inputs)\n out = {}.with_indifferent_access\n self._fields.each_pair do |field, config|\n if inputs.has_key?(field)\n out[field] = type_caster.cast(inputs[field], config[:type])\n end\n end\n\n out\n end", "title": "" }, { "docid": "f22eeaa2bf784b54fd26a2f0bd66ce82", "score": "0.5419756", "text": "def serializer_args_hash\n result = {}\n #TODO: Should probably safety check these somewhere\n result[:entry_type] = params[:entry_type] if params[:entry_type].present? \n result[:section] = params[:section] if params[:section].present?\n return result\n end", "title": "" }, { "docid": "cb4a7773e2a446e20444fd60bc989663", "score": "0.54160196", "text": "def normalize_spec(spec)\n spec.inject({}) do |normalized, (name, direction)|\n normalized[database_field_name(name).to_sym] = direction\n normalized\n end\n end", "title": "" }, { "docid": "022104505e01b3335d4e49df8194f657", "score": "0.5409497", "text": "def conversicate\n hash = self.attributes.dup\n\n # Apparently for conversica:\n # 1) they do not like to receive nil values so we need to remove the nils\n # 2) we also need to convert integers into strings\n hash.reject! { |_k, v| v.nil? }\n hash.transform_values! { |v| v = v.is_a?(Integer) ? v.to_s : v }\n hash.transform_keys! { |k| k.camelize(:lower) }\n hash\n end", "title": "" }, { "docid": "bdbfac004b1c608c39d18ad109bd3132", "score": "0.538065", "text": "def to_hash(keys = :camelcase)\n\t\t\thash = super(keys)\n\t\t\treturn hash\n end", "title": "" }, { "docid": "ee2bde9afe77d654cee7ee3a005e0273", "score": "0.53776485", "text": "def recursively_normalize_keys\n recursively_transform_keys { |key| key.downcase.to_sym rescue key }\n end", "title": "" }, { "docid": "8f54674f99fbcb81b1464fdf4a87a491", "score": "0.53726995", "text": "def normalize_keys(hash)\n hash.inject(HashWithIndifferentAccess.new) do |new_hash, (key, value)|\n new_hash[key.parameterize(separator: \"_\")] = value\n new_hash\n end\n end", "title": "" }, { "docid": "6b7ffad89f2080137be9af01a39ad5a5", "score": "0.5371793", "text": "def deep_symbolize_keys!\n deep_transform_keys!{ |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "c8093885b3245d3d9c9868038ab7e3be", "score": "0.5369859", "text": "def symbolize_keys!\n transform_keys!{ |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "9acd6f3daa35ee29cb92bd3487e70056", "score": "0.5369491", "text": "def symbolize_keys!\n transform_keys! { |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "9acd6f3daa35ee29cb92bd3487e70056", "score": "0.5369491", "text": "def symbolize_keys!\n transform_keys! { |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "9acd6f3daa35ee29cb92bd3487e70056", "score": "0.5369491", "text": "def symbolize_keys!\n transform_keys! { |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "e9fc67b35386f0e77cb33387e73c9975", "score": "0.53662324", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash\n ambiguous_param\n when ActionController::Parameters\n ambiguous_param.to_unsafe_hash\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "b123fe591030ffff785e1905f62b39a0", "score": "0.5360407", "text": "def make_camelcase_keys\n json_data.mappable!\n end", "title": "" }, { "docid": "1e66d07146f02ed80683da1387d00435", "score": "0.53561485", "text": "def initialize(*_)\n super\n @_camel_keys = true\n _set_state :hash_load_struct => true\n end", "title": "" }, { "docid": "26fcf6826c302cdf09a13a4d227117b1", "score": "0.5339481", "text": "def attributes\n super.map { |k, v| [ k.to_s.camelize(:lower).to_sym, v ] }.to_h\n end", "title": "" }, { "docid": "cb45b1370a5227aae3fb4a6fd2f2293c", "score": "0.53344095", "text": "def deep_camelize_keys!(first_letter = :upper)\n deep_transform_keys! { |key| key.to_s.camelize(first_letter) rescue key }\n end", "title": "" }, { "docid": "ea627e0434dd2c8b38e2ee7a4749dc9c", "score": "0.53262544", "text": "def coerce_keys(*attrs); end", "title": "" }, { "docid": "af1e7573559a6a5035328ce8d091f0d1", "score": "0.53210235", "text": "def symbolize_keys!\n replace symbolize_keys\n end", "title": "" }, { "docid": "b702683d83c4c92ccfe2a10912e2d670", "score": "0.53172463", "text": "def deep_symbolize_keys!\n deep_transform_keys!{ |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "b702683d83c4c92ccfe2a10912e2d670", "score": "0.5316805", "text": "def deep_symbolize_keys!\n deep_transform_keys!{ |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "b702683d83c4c92ccfe2a10912e2d670", "score": "0.5316805", "text": "def deep_symbolize_keys!\n deep_transform_keys!{ |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "d1a194d63a01331070693d801e1381ce", "score": "0.5279593", "text": "def rubyize_keys\n transform_keys do |key|\n key\n .to_s\n .gsub(/([A-Z]+)([A-Z][a-z])/, '\\1_\\2')\n .gsub(/([a-z\\d])([A-Z])/, '\\1_\\2')\n .downcase\n .to_sym\n end\n end", "title": "" }, { "docid": "79184af9d7b617d47d34afb3d52a8912", "score": "0.52788424", "text": "def convert_args!(args)\n args.clean_options!\n\n args[:ngrams] = Integer(args[:ngrams]) if args[:ngrams]\n args[:block_size] = Integer(args[:block_size]) if args[:block_size]\n args[:num_blocks] = Integer(args[:num_blocks]) if args[:num_blocks]\n args[:num_words] = Integer(args[:num_words]) if args[:num_words]\n args[:last_block] = args[:last_block].to_sym if args[:last_block]\n args[:stop_list] = Documents::StopList.find_by(language: args[:stop_list]) if args[:stop_list]\n args[:stemming] = args[:stemming].to_sym if args[:stemming]\n args[:stemming] = nil if args[:stemming] == :no\n args[:inclusion_list] = args[:inclusion_list].mb_chars.downcase.to_s if args[:inclusion_list]\n args[:exclusion_list] = args[:exclusion_list].mb_chars.downcase.to_s if args[:exclusion_list]\n\n if args[:split_across]\n if args[:split_across] == '1'\n args[:split_across] = true\n else\n args[:split_across] = false\n end\n end\n end", "title": "" }, { "docid": "c000a208781c52a874cc04dd14c5d65a", "score": "0.5275254", "text": "def convert_attributes(attributes={})\n attributes.to_hash rescue attributes.to_h\n end", "title": "" }, { "docid": "a748f7124b3daf18d6ffb5e26c96f738", "score": "0.52707386", "text": "def infer_args(opts)\n opts.map do |hash|\n if hash.has_key?(:name)\n hash\n else\n check = [:type, :match, :constraint, :within, :default]\n if check.any? {|key| hash.has_key?(key) }\n hash.merge! :name => 'arg'\n end\n\n if hash.has_key?(:default) && !hash.has_key?(:optional)\n hash.merge! :optional => true\n end\n\n hash\n end\n end\n end", "title": "" }, { "docid": "f85d6a20608ceb0285938166949d18f9", "score": "0.52658397", "text": "def deep_symbolize_keys!\n deep_transform_keys! { |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "f85d6a20608ceb0285938166949d18f9", "score": "0.52658397", "text": "def deep_symbolize_keys!\n deep_transform_keys! { |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "f85d6a20608ceb0285938166949d18f9", "score": "0.52658397", "text": "def deep_symbolize_keys!\n deep_transform_keys! { |key| key.to_sym rescue key }\n end", "title": "" }, { "docid": "7b0abf26023d6d3d0bae43fdcfdef0a0", "score": "0.5259877", "text": "def symbolize_redis_client_args(redis_client_args)\n # redis_client_args = redis_client_args.inject({}) {|memo, (k, v)| memo[k.to_sym] = v; memo}\n redis_client_args = recursive_symbolize(redis_client_args)\n unless redis_client_args.fetch(:sentinels, nil).nil?\n redis_client_args[:sentinels] = redis_client_args[:sentinels].map do |sentinel|\n sentinel.inject({}) {|memo, (k, v)| memo[k.to_sym] = v; memo}\n end\n end\n\n redis_client_args\n end", "title": "" }, { "docid": "886654f6e7b648e8238d40717f027927", "score": "0.5250959", "text": "def load_param\n to_hash.select { |_key, value| value }\n .map { |key, value| [key.to_s.split('_').map(&:capitalize).join.sub!(/\\D/, &:downcase), value] }\n .to_h\n end", "title": "" }, { "docid": "cb3884c25a0ea5c55fe47928ad79df55", "score": "0.5222551", "text": "def to_input_hash(optional_options_keys, full_options)\n optional_options_hash = full_options.select { |option| optional_options_keys.include?(option.to_sym) }\n optional_options_hash.transform_keys { |k| k.to_s.underscore.to_sym }\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "18029d5e88047932251ebef91b56186a", "score": "0.5215379", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n if ambiguous_param.present?\n ensure_hash(JSON.parse(ambiguous_param))\n else\n {}\n end\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "e00d3861578dadb5d38e83b9b89f25fc", "score": "0.52124053", "text": "def meaningful_arguments(arguments)\n self_arguments = self.arguments\n result = {}\n arguments.each_assigned_argument do |key, value|\n if self_arguments.include?(key)\n result[key] = value\n end\n end\n result\n end", "title": "" }, { "docid": "cb98e2a80deb88eb6cc39ff41e12848f", "score": "0.5199942", "text": "def normalize_options(options)\n options = options.inject({}) { |h, (k,v)| h[k.downcase] = v ; h }\n options[:rackup] = options[:config] if options[:config]\n options[:port] = options[:port].to_i if options[:port]\n options\n end", "title": "" }, { "docid": "2fc2a4e5b9aad529ab7a6992c4d8852f", "score": "0.519586", "text": "def to_strongly_typed_hash(cli_hash)\n nil if cli_hash.nil?\n cli_hash.each do |key, value|\n case value\n when \"__undefined__\"\n cli_hash[key] = nil\n when true\n cli_hash[key] = true\n when false\n cli_hash[key] = false\n when Hash\n cli_hash[key] = to_strongly_typed_hash(value)\n end\n end\n cli_hash\n end", "title": "" }, { "docid": "dff3d6d5145014b7dd8e7e88d6f47e28", "score": "0.5194059", "text": "def transform_params\n params.transform_keys! { |key| key.tr(\"-\", \"_\") }\n end", "title": "" }, { "docid": "b7e319a7f521e2744fcd1af65c6038db", "score": "0.5192126", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n ambiguous_param.present? ? ensure_hash(JSON.parse(ambiguous_param)) : {}\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "b7e319a7f521e2744fcd1af65c6038db", "score": "0.5192126", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n ambiguous_param.present? ? ensure_hash(JSON.parse(ambiguous_param)) : {}\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "000611d81365d36a60b2f1117e89afc7", "score": "0.5186934", "text": "def key_coercions; end", "title": "" }, { "docid": "c6deaa4b6ca617c90c1f122486f2b9f8", "score": "0.5186752", "text": "def auto_camelize(data)\n if Cody.settings[:auto_camelize]\n CfnCamelizer.transform(data)\n else\n data.deep_stringify_keys!\n end\n end", "title": "" }, { "docid": "faa7857aebc2df65d99d80cfc869ab86", "score": "0.5185811", "text": "def symbolize_keys!\n replace(self.symbolize_keys)\n end", "title": "" }, { "docid": "1b84c3bd20403c80c0c286ae62239fcc", "score": "0.5184995", "text": "def symbolize_hash(old_hash)\n old_hash.each_with_object({}) { |(k, v), new_hash|\n new_hash[k.to_sym] = if v.is_a?(Hash)\n symbolize_hash(v)\n elsif v.is_a?(Array)\n v.map{ |h| h.is_a?(Hash) ? symbolize_hash(h) : h }\n else\n v\n end\n }\n end", "title": "" }, { "docid": "4676b8eca0c8e1a1426c7fb40024bcb0", "score": "0.5180368", "text": "def normalize_parameters(params)\n params.delete_if {|k,v| v.nil? || v.to_s.empty? }\n params.update(defaults)\n params\n end", "title": "" }, { "docid": "21fe4d0192919ab0d8187bdf1a5ace63", "score": "0.51780653", "text": "def to_attributes\n to_hash(downcase: true)\n end", "title": "" }, { "docid": "21fe4d0192919ab0d8187bdf1a5ace63", "score": "0.51780653", "text": "def to_attributes\n to_hash(downcase: true)\n end", "title": "" }, { "docid": "21fe4d0192919ab0d8187bdf1a5ace63", "score": "0.51780653", "text": "def to_attributes\n to_hash(downcase: true)\n end", "title": "" }, { "docid": "b312b204f4af0475a74e0e0fc3500714", "score": "0.5174894", "text": "def symbolize_keys!\n self.replace(self.symbolize_keys)\n end", "title": "" }, { "docid": "b312b204f4af0475a74e0e0fc3500714", "score": "0.5174894", "text": "def symbolize_keys!\n self.replace(self.symbolize_keys)\n end", "title": "" }, { "docid": "b312b204f4af0475a74e0e0fc3500714", "score": "0.5174894", "text": "def symbolize_keys!\n self.replace(self.symbolize_keys)\n end", "title": "" }, { "docid": "b312b204f4af0475a74e0e0fc3500714", "score": "0.5174894", "text": "def symbolize_keys!\n self.replace(self.symbolize_keys)\n end", "title": "" }, { "docid": "b312b204f4af0475a74e0e0fc3500714", "score": "0.5174894", "text": "def symbolize_keys!\n self.replace(self.symbolize_keys)\n end", "title": "" }, { "docid": "b312b204f4af0475a74e0e0fc3500714", "score": "0.5174894", "text": "def symbolize_keys!\n self.replace(self.symbolize_keys)\n end", "title": "" }, { "docid": "3f7ea69c4e0577db3009ad26de5ccfcd", "score": "0.51730144", "text": "def prep_merge_fields(merge_fields)\n # Upper-case all the keys as this is how MC expect them.\n merge_fields.map { |k, v| [k.upcase, v] }.to_h\n end", "title": "" }, { "docid": "7003e7a9bffaedaeb6149d8cc9c5ee6f", "score": "0.5158522", "text": "def ensure_hash(ambiguous_param)\n return {} if ambiguous_param.blank?\n\n case ambiguous_param\n when String\n ensure_hash(JSON.parse(ambiguous_param))\n when Hash, ActionController::Parameters\n ambiguous_param\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "e4447a6f2b929348fd73bc1b66a6fbd8", "score": "0.51527655", "text": "def symbolize_keys\r\n inject({}) do |options, (key, value)|\r\n options[(key.to_sym rescue key) || key] = value\r\n options\r\n end\r\n end", "title": "" }, { "docid": "f25d3551130cefbdc3bfdcf3e502d63c", "score": "0.5151694", "text": "def normalize_hash(hash)\n normalized_hash = {}\n hash.each do |k, v|\n case k \n when \"error\"\n raise FacebookError.new(\"#{v['type']} - #{v['message']}\")\n when \"id\"\n if (v == v.to_i.to_s)\n normalized_hash[k.to_sym] = v.to_i \n else\n normalized_hash[k.to_sym] = v \n end\n when /_time$/\n normalized_hash[k.to_sym] = Time.parse(v)\n else\n data = extract_data(v)\n case data\n when Hash\n normalized_hash[k.to_sym] = normalize_hash(data)\n when Array\n normalized_hash[k.to_sym] = normalize_array(data)\n else\n normalized_hash[k.to_sym] = data\n end\n end\n end\n normalized_hash\n end", "title": "" }, { "docid": "964273a35817207917aa620ed85f1b54", "score": "0.5148664", "text": "def normalize_param_value(key)\n p = params.fetch(key.to_sym, {})\n case p\n when Hash\n ActionController::Parameters.new(p)\n when ActionController::Parameters\n p\n when String\n begin\n ActionController::Parameters.new(normalize_params(JSON.parse(p)))\n rescue\n ActionController::Parameters.new({ })\n end\n else\n ActionController::Parameters.new({ })\n end\n end", "title": "" }, { "docid": "db92f8814cc98793a93a0d8bcc3516f2", "score": "0.5147896", "text": "def normalize_options(options = {})\n return options if options.class == Hash\n {:table_class => options}\n end", "title": "" }, { "docid": "50310be055f68489515a2c7ef0886d4c", "score": "0.51475036", "text": "def ensure_hash(ambiguous_param)\n case ambiguous_param\n when String\n ambiguous_param.present? ? ensure_hash(JSON.parse(ambiguous_param)) : {}\n when Hash, ActionController::Parameters\n ambiguous_param\n when nil\n {}\n else\n raise ArgumentError, \"Unexpected parameter: #{ambiguous_param}\"\n end\n end", "title": "" }, { "docid": "ee8c5b840f3766a05d8e3e7298c811f4", "score": "0.51470655", "text": "def symbolize_keys!\r\n self.replace(self.symbolize_keys)\r\n end", "title": "" }, { "docid": "469c5fe4d8480f007d3cd7eeb92291dc", "score": "0.5145458", "text": "def keys_to_snake_case(hash)\n hash.transform_keys do |key|\n key.gsub(%r{([A-Z]+)([A-Z][a-z])}, '\\1_\\2')\n .gsub(%r{([a-z\\d])([A-Z])}, '\\1_\\2')\n .downcase\n .to_sym\n end\n end", "title": "" }, { "docid": "9d58c65f6cf60bcaddb011cfd4ec731f", "score": "0.5143987", "text": "def normalize_for_json!\n @inputs.each do |input|\n input.args = input.args.map do |arg|\n Ckb::Utils.bin_to_hex(\n Ckb::Utils.delete_prefix(arg)\n )\n end\n end\n\n @outputs.each do |output|\n output.data = Ckb::Utils.bin_to_hex(\n Ckb::Utils.delete_prefix(output.data)\n )\n output.lock.args = output.lock.args.map do |arg|\n Ckb::Utils.bin_to_hex(\n Ckb::Utils.delete_prefix(arg)\n )\n end\n\n next unless output.type\n\n output.type.args = output.type.args.map do |arg|\n Ckb::Utils.bin_to_hex(\n Ckb::Utils.delete_prefix(arg)\n )\n end\n end\n\n self\n end", "title": "" } ]
b75faa4f5e0fcf08fb8db6412a435113
GET /worksheets/new GET /worksheets/new.json
[ { "docid": "a57c1df63dd1421a7120f9d09e0ca7bc", "score": "0.7854272", "text": "def new\n @worksheet = Worksheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @worksheet }\n end\n end", "title": "" } ]
[ { "docid": "3af82dc4002790cf2399ac8a65c5c8ad", "score": "0.77463704", "text": "def new\n @spreadsheet = @package.spreadsheets.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spreadsheet }\n end\n end", "title": "" }, { "docid": "74a403dc179be0d6203e261422cccd7f", "score": "0.7545232", "text": "def new\n @sheet = Sheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sheet }\n end\n end", "title": "" }, { "docid": "74a403dc179be0d6203e261422cccd7f", "score": "0.7545232", "text": "def new\n @sheet = Sheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sheet }\n end\n end", "title": "" }, { "docid": "511b7d34a22df70f7fc4eafcb6d3e63c", "score": "0.74752", "text": "def new\n @sheet = Sheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @sheet }\n end\n end", "title": "" }, { "docid": "83896cc756ede603d95a05fe476d49f3", "score": "0.7154873", "text": "def create\n @spreadsheet = SpreadsheetCreator.new(params).create!\n json_response(@spreadsheet)\n end", "title": "" }, { "docid": "a54c770238057e7aee92ca904704f9bb", "score": "0.7120309", "text": "def new\n @weeksheet = Weeksheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weeksheet }\n end\n end", "title": "" }, { "docid": "391754ba993e8389cdaf9eae61d981b2", "score": "0.699131", "text": "def new\n @worksheet = Worksheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @worksheet }\n end\n end", "title": "" }, { "docid": "7afc55ec4384951bde1d58ce8bf56624", "score": "0.69831526", "text": "def new\n @workbook = Workbook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @workbook }\n end\n end", "title": "" }, { "docid": "1a7070f6a7ae88b612481d28487067fb", "score": "0.6933526", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @time_sheet }\n end\n end", "title": "" }, { "docid": "7364bb8684be150d2b30ad8a1caeb06d", "score": "0.69279796", "text": "def create\n @worksheet = Worksheet.new(worksheet_params)\n\n respond_to do |format|\n if @worksheet.save\n format.html { redirect_to @worksheet, notice: 'Анкета успешно создана.' }\n format.json { render action: 'show', status: :created, location: @worksheet }\n else\n format.html { render action: 'new' }\n format.json { render json: @worksheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ac90c71a4b436b24dd3a5f189d524fe", "score": "0.6881372", "text": "def new\n @time_sheet = TimeSheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @time_sheet }\n end\n end", "title": "" }, { "docid": "2ac90c71a4b436b24dd3a5f189d524fe", "score": "0.6881372", "text": "def new\n @time_sheet = TimeSheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @time_sheet }\n end\n end", "title": "" }, { "docid": "8a42628ff6e4f94deb67df78e0ebbe24", "score": "0.6869004", "text": "def create\n @sheet = Sheet.new(params[:sheet])\n\n respond_to do |format|\n if @sheet.save\n format.html { redirect_to sheets_path, notice: \"Sheet #{@sheet.name} was successfully created.\" }\n format.json { render json: @sheet, status: :created, location: @sheet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a62419a49efb10aab24d2e690bb50c3c", "score": "0.68492", "text": "def new\n @timesheet = Timesheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @timesheet }\n end\n end", "title": "" }, { "docid": "47dd5f555de29cf1f2d1aee68bae289f", "score": "0.6814621", "text": "def new\n @cheatsheet = Cheatsheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cheatsheet }\n end\n end", "title": "" }, { "docid": "9151273af4ef0946af0c203a808dd96e", "score": "0.6789629", "text": "def create\n @sheet = Sheet.new(params[:sheet])\n\n respond_to do |format|\n if @sheet.save\n format.html { redirect_to @sheet, notice: 'Sheet was successfully created.' }\n format.json { render json: @sheet, status: :created, location: @sheet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a0700da8f1bec53d306035550b25ebc", "score": "0.6777678", "text": "def create\n @worksheet = Worksheet.new(worksheet_params)\n\n respond_to do |format|\n if @worksheet.save\n format.html { redirect_to @worksheet, notice: \"Worksheet was successfully created.\" }\n format.json { render :show, status: :created, location: @worksheet }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @worksheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd13c3d91b700054ce832acf65a4de56", "score": "0.67433757", "text": "def new\n @excel = Excel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @excel }\n end\n end", "title": "" }, { "docid": "87aa9d9c8c6db4d33e7e661154eb0f87", "score": "0.6709927", "text": "def new\n @score_sheet = ScoreSheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @score_sheet }\n end\n end", "title": "" }, { "docid": "98fdba64eb3b74c461105275a0919393", "score": "0.66710263", "text": "def new\n @spread = Spread.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spread }\n end\n end", "title": "" }, { "docid": "b37c917ba73efb58a54b8ee69ecc2af7", "score": "0.6638209", "text": "def create\n respond_to do |format|\n if @time_sheet.save\n format.html { redirect_to @time_sheet, notice: 'Time Sheet was successfully created.' }\n format.json { render json: @time_sheet, status: :created, location: @time_sheet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @time_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "385621e7a5ded62184cf86228206fbf9", "score": "0.6631556", "text": "def create\n @sheet = Sheet.new(sheet_params)\n user = User.find(current_user)\n\n respond_to do |format|\n if user.sheets << @sheet\n log = Log.new(:text => \"create sheet #{@sheet.title}\")\n @sheet.logs << log\n format.html { redirect_to @sheet}\n format.json { render :json => @sheet, :status => :created, :location => @sheet }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @sheet.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30b109d3ffcb4fe541129cbf3061f3c7", "score": "0.6564048", "text": "def create\n @spreadsheet = Spreadsheet.new(spreadsheet_params)\n\n respond_to do |format|\n if @spreadsheet.save\n format.html { redirect_to @spreadsheet, notice: 'Spreadsheet was successfully created.' }\n format.json { render :show, status: :created, location: @spreadsheet }\n else\n format.html { render :new }\n format.json { render json: @spreadsheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5e4932774da5b03bcae9f08fe6ed084", "score": "0.65498847", "text": "def create\n @sheet = Sheet.new(sheet_params)\n\n respond_to do |format|\n if @sheet.save\n format.html { redirect_to @sheet, notice: 'Sheet was successfully created.' }\n format.json { render :show, status: :created, location: @sheet }\n else\n format.html { render :new }\n format.json { render json: @sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be42022cbe246a4ccbdbddaced884df7", "score": "0.6486411", "text": "def new\n @timesheet = Timesheet.new\n \n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @timesheet }\n end\n end", "title": "" }, { "docid": "804256452da8a3f23fd831c3f8626be3", "score": "0.64786184", "text": "def create\n @time_sheet = TimeSheet.new(params[:time_sheet])\n\n respond_to do |format|\n if @time_sheet.save\n format.html { redirect_to time_sheets_path, notice: 'Time sheet was successfully created.' }\n format.json { render json: @time_sheet, status: :created, location: @time_sheet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @time_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0cead9aab9fc7a2546523f3d05593fc6", "score": "0.64608437", "text": "def new\n @routing_sheet_detail = RoutingSheetDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @routing_sheet_detail }\n end\n end", "title": "" }, { "docid": "da0d699a425f18d46e6783ed9d3fb8c6", "score": "0.63744646", "text": "def create\n @spreadsheet = @user.spreadsheets.build spreadsheet_params\n\n respond_to do |format|\n if @spreadsheet.save\n format.html { redirect_to [@user, @spreadsheet], notice: t('.notice') }\n format.json { render :show, status: :created, location: @spreadsheet }\n else\n format.html { render :new }\n format.json { render json: @spreadsheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2566cb3f7687e4f4b380637b464d53d9", "score": "0.6333181", "text": "def create\n @cheatsheet = Cheatsheet.new(params[:cheatsheet])\n\n respond_to do |format|\n if @cheatsheet.save\n format.html { redirect_to @cheatsheet, notice: 'Cheatsheet was successfully created.' }\n format.json { render json: @cheatsheet, status: :created, location: @cheatsheet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cheatsheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8eb26fe5daebdbfaba8d3b9cc6cbf61b", "score": "0.63324875", "text": "def new\n @recording_sheet = RecordingSheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recording_sheet }\n end\n end", "title": "" }, { "docid": "523dfe5fd8278c40858d38d6a0d9703a", "score": "0.6317036", "text": "def create\n @timesheet = Timesheet.new(params[:timesheet])\n\n respond_to do |format|\n if @timesheet.save\n format.html { redirect_to @timesheet, notice: 'Timesheet was successfully created.' }\n format.json { render json: @timesheet, status: :created, location: @timesheet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @timesheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7888f0399ff7b40c9ae4eec48b55712e", "score": "0.631018", "text": "def create\n @google_sheet = GoogleSheet.new(google_sheet_params)\n\n respond_to do |format|\n if @google_sheet.save\n format.html { redirect_to @google_sheet, notice: 'Google sheet was successfully created.' }\n format.json { render :show, status: :created, location: @google_sheet }\n else\n format.html { render :new }\n format.json { render json: @google_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a2c1e86df866721c3c36a329357ffb1", "score": "0.630791", "text": "def new\n @google_sheet = GoogleSheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @google_sheet }\n end\n end", "title": "" }, { "docid": "9ffd65d0864db4b96d141815e3e8bd1d", "score": "0.6299458", "text": "def create\n @data_sheet = DataSheet.new(data_sheet_params)\n\n respond_to do |format|\n if @data_sheet.save\n format.html { redirect_to @data_sheet, notice: 'Data sheet was successfully created.' }\n format.json { render :show, status: :created, location: @data_sheet }\n else\n format.html { render :new }\n format.json { render json: @data_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1fa980419293854549d9747b3539c81e", "score": "0.62751895", "text": "def create\n @weeksheet = Weeksheet.new(params[:weeksheet])\n\n respond_to do |format|\n if @weeksheet.save\n format.html { redirect_to @weeksheet, notice: 'Weeksheet was successfully created.' }\n format.json { render json: @weeksheet, status: :created, location: @weeksheet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @weeksheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2076e38aabdf9fbe6cfc935f8b6691ad", "score": "0.6240663", "text": "def new\n @time_sheet_entry = TimeSheetEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @time_sheet_entry }\n end\n end", "title": "" }, { "docid": "dbfa6375d8d5dc6678861a3a0e819d37", "score": "0.6235258", "text": "def new\n @judge_sheet = JudgeSheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @judge_sheet }\n end\n end", "title": "" }, { "docid": "c325ddb88b7d6f820cdd6c0a6c34b254", "score": "0.6218219", "text": "def new\n @pricesheet = Pricesheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pricesheet }\n end\n end", "title": "" }, { "docid": "852889300e5d7b2e8cccb65c1786bda1", "score": "0.6216614", "text": "def create\n @fact_sheet = FactSheet.new(fact_sheet_params)\n\n respond_to do |format|\n if @fact_sheet.save\n format.html { redirect_to @fact_sheet, notice: 'Fact sheet was successfully created.' }\n format.json { render action: 'show', status: :created, location: @fact_sheet }\n else\n format.html { render action: 'new' }\n format.json { render json: @fact_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fda39a8bee7ac1df3ad859294f918591", "score": "0.61737025", "text": "def new\n @time_sheet_entry = TimeSheetEntry.new\n\n respond_to do |format|\n format.html { render layout: false } # new.html.erb\n format.json { render json: @time_sheet_entry }\n end\n end", "title": "" }, { "docid": "f3b5dd9c5cbeca2e852f190a99c92bf8", "score": "0.61725354", "text": "def create\n @sheet = Sheet.new(sheet_params)\n\n o = [('0'..'9')].map(&:to_a).flatten\n loop do\n number = (1..10).map { o[SecureRandom.random_number(o.length)] }.join\n if Sheet.where(:number => number).count == 0\n @sheet.number = number\n break\n end\n end\n\n respond_to do |format|\n if @sheet.save\n format.html { redirect_to @sheet, notice: 'Sheet was successfully created.' }\n format.json { render :show, status: :created, location: @sheet }\n else\n format.html { render :new }\n format.json { render json: @sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d303c1612b1fe50e9ff358eae4e12dc", "score": "0.6170982", "text": "def create\n @time_sheet = @user.time_sheets.new(params[:time_sheet])\n\n respond_to do |format|\n if @time_sheet.save\n format.html { redirect_to user_time_sheets_path(@user), notice: 'Time sheet was successfully created.' }\n format.json { render json: [@user, @time_sheet], status: :created, location: [@user, @time_sheet] }\n else\n format.html { render action: \"new\" }\n format.json { render json: @time_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "317eec4c7491c6f56dd63f3beb496ce5", "score": "0.6160407", "text": "def new\n @prefshift = Prefshift.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prefshift }\n end\n end", "title": "" }, { "docid": "ebb1c4e6e9043eb8ce9f72268aa20922", "score": "0.61534935", "text": "def create\n @google_sheet = GoogleSheet.new(params[:google_sheet])\n\n respond_to do |format|\n if @google_sheet.save\n format.html { redirect_to(@google_sheet, :notice => 'Google sheet was successfully created.') }\n format.xml { render :xml => @google_sheet, :status => :created, :location => @google_sheet }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @google_sheet.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "741226b9556cbe1bcc136ce2690902ba", "score": "0.61437637", "text": "def new\n flash[:warning] = \"New action not permitted for spreadsheets\"\n redirect_to :index\n end", "title": "" }, { "docid": "62a4560f74294118c68d58e4ebfdd03b", "score": "0.6137917", "text": "def new\n @sheet2 = Sheet2.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sheet2 }\n end\n end", "title": "" }, { "docid": "8a0715c7234cedf5e6ccc6449c720b5c", "score": "0.6132292", "text": "def create\n @updatesheet = Updatesheet.new(updatesheet_params)\n\n respond_to do |format|\n if @updatesheet.save\n format.html { redirect_to updatesheets_path, notice: 'Updatesheet was successfully created.' }\n format.json { render :show, status: :created, location: @updatesheet }\n else\n format.html { render :new }\n format.json { render json: @updatesheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de9dd46c0ee3e984af1a52c38269d888", "score": "0.61290294", "text": "def create\n @url = Url.new(params[:workbook])\n \n respond_to do |format|\n if @url.save\n format.html { redirect_to @url, :notice => 'Url was successfully created.' }\n format.json { render :json => @url, :status => :created, :location => @url }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @url.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c7b41deb04106b13eb3f2c221498c93b", "score": "0.61229074", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @brew_sheet }\n end\n end", "title": "" }, { "docid": "445284cff39b37eba8e897fb4f993bfd", "score": "0.6113271", "text": "def create\n @time_sheet = TimeSheet.new(params[:time_sheet])\n\n respond_to do |format|\n if @time_sheet.save\n format.html { redirect_to edit_admin_time_sheet_path(@time_sheet), notice: 'Registro de ponto criado com sucesso!' }\n format.json { render json: @time_sheet, status: :created, location: @time_sheet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @time_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b07e4d092ed9f48decec4d957262b273", "score": "0.61044306", "text": "def new\n @cell = Cell.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cell }\n end\n end", "title": "" }, { "docid": "0a7fa7c32447888a4d1e1c29fd6ee006", "score": "0.61039215", "text": "def create\n\t\trender json: Timesheet.create(timesheet_user, project, task)\n\tend", "title": "" }, { "docid": "d48135c70bb4f0d13d59226a7c6cf8cc", "score": "0.61030954", "text": "def create\n respond_with :api, :v1, Timesheet.create(timesheet_params)\n end", "title": "" }, { "docid": "8490b65a3a57bbb3afa4a664b9556bbb", "score": "0.6102221", "text": "def new\n @poi = Poi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @poi }\n end\n end", "title": "" }, { "docid": "dc4280c47c3e50dcb821abbe366a5dfd", "score": "0.6101418", "text": "def new\r\n @shift = Shift.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @shift }\r\n end\r\n end", "title": "" }, { "docid": "f0a21f5cac92639d49dbe8957ed0c2dd", "score": "0.6100115", "text": "def create\n @team_sheet = TeamSheet.new(team_sheet_params)\n\n respond_to do |format|\n if @team_sheet.save\n format.html { redirect_to @team_sheet, notice: 'Team sheet was successfully created.' }\n format.json { render :show, status: :created, location: @team_sheet }\n else\n format.html { render :new }\n format.json { render json: @team_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3cce59bf1350a9e88b8d28f3df344809", "score": "0.609897", "text": "def new\n @fabric_information_sheet = FabricInformationSheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fabric_information_sheet }\n end\n end", "title": "" }, { "docid": "99a8cf4e9d61977aada2c43a3b93fa01", "score": "0.60796565", "text": "def new\n @shift = Shift.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shift }\n end\n end", "title": "" }, { "docid": "92a056a81e289297f835d5e7b2a20e2e", "score": "0.6069683", "text": "def new\n @new_table = NewTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @new_table }\n end\n end", "title": "" }, { "docid": "c291eb303b42e1f2d40d889e5867393f", "score": "0.6055901", "text": "def new\n @style = Style.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @style }\n end\n end", "title": "" }, { "docid": "31611e282e5a2d3f1f18053524692cc1", "score": "0.605209", "text": "def new\r\n @shift = Shift.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render :json => @shift }\r\n end\r\n end", "title": "" }, { "docid": "d2782afda9a872acdc3f18afe5e35b56", "score": "0.60384506", "text": "def new\n @workspace = Workspace.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @workspace }\n end\n end", "title": "" }, { "docid": "d86619ba44a30bb84fb35da8bef81528", "score": "0.60377795", "text": "def create\n @timesheet = current_user.timesheets.build(timesheet_params)\n\n respond_to do |format|\n if @timesheet.save\n format.html { redirect_to root_path, notice: 'Timesheet was successfully created.' }\n format.json { render :show, status: :created, location: @timesheet }\n else\n format.html { render :new }\n format.json { render json: @timesheet.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a8584a83f4201ab6c04536f4cfb0f8b", "score": "0.60316473", "text": "def new\n @poi = Poi.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @poi }\n end\n end", "title": "" }, { "docid": "720863e3da07b3f6eee01b0ac013c215", "score": "0.6025748", "text": "def new\n authorize! :create, MappingTemplate\n if params[:mapping_template] && params[:mapping_template][:worksheet_id]\n @worksheet = Worksheet.find(params[:mapping_template][:worksheet_id])\n elsif params[:node_id]\n if params[:node_id].include?(\"-\")\n @source_node = Bindery::Spreadsheet.version_with_latest_file_binding(params[:node_id])\n else\n current_node = Bindery::Spreadsheet.find_by_identifier(params[:node_id])\n @source_node = current_node.version_with_current_file_binding\n end\n @worksheet = @source_node.worksheets.first\n else \n raise ArgumentError, \"You must provide either mapping_template[worksheet_id] or node_id parameter in order to create a new MappingTemplate.\"\n end\n mappings = []\n header_row = @worksheet.rows[0] #this is a bad assumption\n header_row.values.each_with_index { |value, n| mappings << {:source=> (n+65).chr, :label => value }}\n @mapping_template = MappingTemplate.new(:model_mappings=>[{:field_mappings=>mappings}])\n respond_to do |format|\n format.html { render action: 'new' }\n format.json { render json: @mapping_template }\n end\n end", "title": "" }, { "docid": "ae858a02db2824755f66a9e8724123db", "score": "0.6023483", "text": "def new\n @weekly_schedule = WeeklySchedule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weekly_schedule }\n end\n end", "title": "" }, { "docid": "808265854221affa49c9cab14e60aab7", "score": "0.60158205", "text": "def create\n @question_sheet = QuestionSheet.new_with_page\n \n respond_to do |format|\n if @question_sheet.save\n format.html { redirect_to question_sheet_path(@question_sheet) }\n format.xml { head :created, :location => question_sheet_path(@question_sheet) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @question_sheet.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "c54b802105cb20d546ee845d7588089f", "score": "0.601491", "text": "def new\n @poi = Poi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @poi }\n end\n end", "title": "" }, { "docid": "24e83896a2984f03197a7fd6565a9460", "score": "0.6012888", "text": "def create\n @cheatsheet = Cheatsheet.new(cheatsheet_params)\n\n respond_to do |format|\n if @cheatsheet.save\n format.html { redirect_to @cheatsheet, notice: 'Cheatsheet was successfully created.' }\n format.json { render :show, status: :created, location: @cheatsheet }\n else\n format.html { render :new }\n format.json { render json: @cheatsheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "caf9b6edf569ded71026b244e97ce8ee", "score": "0.6012719", "text": "def create\n @workbook = Workbook.new(params[:workbook])\n \n respond_to do |format|\n if @workbook.save\n \turl_array = parse_bookmark_file(@workbook.bookmark.path)\n \turl_array.each do |url|\n\t @workbook.urls.build(:url => url, :use => false)\n\t @workbook.save\n\t end\n format.html { redirect_to @workbook, :notice => 'Workbook was successfully created.' }\n format.json { render :json => @workbook, :status => :created, :location => @workbook }\n\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @workbook.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5da16b2c91298b65822f602999d1754d", "score": "0.60103536", "text": "def new_stories\n get('/newstories.json')\n end", "title": "" }, { "docid": "ff701596ab495ab0e83dda13e47092c2", "score": "0.60102814", "text": "def new\n @ratesheet = Ratesheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ratesheet }\n end\n end", "title": "" }, { "docid": "8a9906e321418edfe38d51e2ded67cc2", "score": "0.600894", "text": "def create\n @history_timesheet = HistoryTimesheet.new(history_timesheet_params)\n\n respond_to do |format|\n if @history_timesheet.save\n format.html { redirect_to @history_timesheet, notice: 'History timesheet was successfully created.' }\n format.json { render :show, status: :created, location: @history_timesheet }\n else\n format.html { render :new }\n format.json { render json: @history_timesheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7377dbdc7cf8c59b2b357d242b2bfcff", "score": "0.60074717", "text": "def new\n @timesheet = Timesheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @timesheet }\n end\n end", "title": "" }, { "docid": "7377dbdc7cf8c59b2b357d242b2bfcff", "score": "0.60074717", "text": "def new\n @timesheet = Timesheet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @timesheet }\n end\n end", "title": "" }, { "docid": "b206b167d059319785df007c55a19e76", "score": "0.6006421", "text": "def new\n @style = Style.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @style }\n end\n end", "title": "" }, { "docid": "c0c5778ff729a9681ac671c96e7ad7dc", "score": "0.6004496", "text": "def create\n @excel = Excel.new(params[:excel])\n\n respond_to do |format|\n if @excel.save\n format.html { redirect_to @excel, notice: 'Excel was successfully created.' }\n format.json { render json: @excel, status: :created, location: @excel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @excel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86386de4579c2369832fbccab8c7316c", "score": "0.6003555", "text": "def new\n @sprint = Sprint.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sprint }\n end\n end", "title": "" }, { "docid": "574c0c57e772e7fec670ff3263a452f3", "score": "0.59938747", "text": "def new\n\t @title = \"New Style\" \n @style = Style.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @style }\n end\n end", "title": "" }, { "docid": "0e9a6514bbc32f66a970d0e945eea31e", "score": "0.5980276", "text": "def new\n @sprint = Sprint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sprint }\n end\n end", "title": "" }, { "docid": "86f280111e507ce4f4a9c62cbedddd86", "score": "0.59611946", "text": "def new\n @timesheet_detail = TimesheetDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @timesheet_detail }\n end\n end", "title": "" }, { "docid": "9d8150649cbf4a184829b20e6b3fd845", "score": "0.59568155", "text": "def create\n @new_table = NewTable.new(params[:new_table])\n\n respond_to do |format|\n if @new_table.save\n format.html { redirect_to @new_table, :notice => 'New table was successfully created.' }\n format.json { render :json => @new_table, :status => :created, :location => @new_table }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @new_table.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c494fc411ab42de5247bed0af4f274b", "score": "0.59554183", "text": "def new\n @work_space_app = WorkSpaceApp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work_space_app }\n end\n end", "title": "" }, { "docid": "3c7e103143624d4c57dfd25170459f12", "score": "0.5947915", "text": "def new\n @cell_type = CellType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cell_type }\n end\n end", "title": "" }, { "docid": "55e58c125eca141c71a1d278e2e2dc23", "score": "0.5946482", "text": "def new\n @newsscript = Newsscript.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newsscript }\n end\n end", "title": "" }, { "docid": "33c16d8159e3167b69860e9f147fb96a", "score": "0.5941459", "text": "def new\n @workplace = Workplace.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @workplace }\n end\n end", "title": "" }, { "docid": "9cdf059c6e8f4257fe5fd7a6e7bf4e3e", "score": "0.5937372", "text": "def create\n @updatesheet = Updatesheet.new(updatesheet_params)\n\n respond_to do |format|\n if @updatesheet.save\n format.html { redirect_to @updatesheet, notice: 'Updatesheet was successfully created.' }\n format.json { render :show, status: :created, location: @updatesheet }\n else\n format.html { render :new }\n format.json { render json: @updatesheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "308bfa2f9608df3c5d7ef5e109b3af68", "score": "0.5929991", "text": "def create\n p_attr = params[:spreadsheet]\n p_attr[:manifest] = params[:spreadsheet][:manifest].first if params[:spreadsheet][:manifest].class == Array\n\n @spreadsheet = @package.spreadsheets.new(p_attr)\n\n if @spreadsheet.save\n respond_to do |format|\n format.html {\n render :json => [@spreadsheet.to_jq_upload(@package.id)].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json {\n render :json => [@spreadsheet.to_jq_upload(@package.id)].to_json\n }\n end\n else\n if @spreadsheet.manifest_integrity_error\n render :json => [{:error => @spreadsheet.manifest_integrity_error}], :status => 415\n else\n render :json => [{:error => @spreadsheet.errors}], :status => 422\n end\n end\n end", "title": "" }, { "docid": "cc8abceeec273ec4532409269b0b92f4", "score": "0.59225565", "text": "def add_worksheet(name = nil)\n if name.nil? then\n n = 0\n\n begin\n name = SHEET_NAME_TEMPLATE % (n += 1)\n end until self[name].nil?\n end\n\n new_worksheet = Worksheet.new(:workbook => self, :sheet_name => name)\n worksheets << new_worksheet\n new_worksheet\n end", "title": "" }, { "docid": "f449e25971fcdc5de4ffe3d690063d0f", "score": "0.59219056", "text": "def new\n @brewstyle = Brewstyle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @brewstyle }\n end\n end", "title": "" }, { "docid": "fab33cf997b954c99a4077f3ed502607", "score": "0.5919424", "text": "def new\n @shift_assignment = ShiftAssignment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shift_assignment }\n end\n end", "title": "" }, { "docid": "9d3c28f560f02635bc5a7386a0d16bc3", "score": "0.5916151", "text": "def create\n\t\t@timesheet = Timesheet.new(timesheet_params)\n\t\tif @timesheet.save\n\t\t\tredirect_to '/timesheet'\n\t\telse\n\t\t\trender 'new'\n\t\tend\n\tend", "title": "" }, { "docid": "9e4c396a25504a421b2a640713cdb730", "score": "0.59150606", "text": "def create\n @team_sheet = TeamSheet.new(team_sheet_params)\n respond_to do |format|\n if @team_sheet.save\n format.html { redirect_to user_team_sheet_path(@team_sheet), notice: 'Team sheet was successfully created.' }\n format.json { render json: { teamsheet: @team_sheet }, status: :ok }\n else\n format.html { render :new }\n format.json { render json: @team_sheet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ee04434a196da236f65fc7dc4c13507a", "score": "0.5913522", "text": "def create\n @employee_time_sheet = EmployeeTimeSheet.new(employee_time_sheet_params)\n\n respond_to do |format|\n if @employee_time_sheet.save\n format.html {redirect_to @employee_time_sheet, notice: 'Employee time sheet was successfully created.'}\n format.json {render :show, status: :created, location: @employee_time_sheet}\n else\n format.html {render :new}\n format.json {render json: @employee_time_sheet.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "47b0687a62e05a0b8710042bb10c37f7", "score": "0.5912409", "text": "def create\n @judge_sheet = JudgeSheet.new(params[:judge_sheet])\n\n respond_to do |format|\n if @judge_sheet.save\n format.html { redirect_to @judge_sheet, :notice => 'Judge sheet was successfully created.' }\n format.json { render :json => @judge_sheet, :status => :created, :location => @judge_sheet }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @judge_sheet.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a46192c4386a930af35d481ebb22ab3", "score": "0.59111786", "text": "def create\n @spread = Spread.new(spread_params)\n\n respond_to do |format|\n if @spread.save\n format.html { redirect_to @spread, notice: 'Spread was successfully created.' }\n format.json { render json: @spread, status: :created, location: @spread }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spread.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ad93a746b564637acb851aa69b880c4", "score": "0.59105104", "text": "def new\r\n @weekly_add = WeeklyAdd.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @weekly_add }\r\n end\r\n end", "title": "" }, { "docid": "3272118c430bddffed2bc46787b27880", "score": "0.59087104", "text": "def new\n @worksite = Worksite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @worksite }\n end\n end", "title": "" }, { "docid": "fbc2874c9c037167d908cbcec1fc745b", "score": "0.5908232", "text": "def new\n @work_schedule = WorkSchedule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work_schedule }\n end\n end", "title": "" }, { "docid": "33b17f1bb683433beeea46e5558f7fb4", "score": "0.59077233", "text": "def new\n#raise \"new\".inspect\n @timesheet = Timesheet.new\n @timesheet.timesheet_details.build \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @timesheet }\n end\n end", "title": "" } ]
34241605a43189d9f91f367d50232077
POST /faafacilities POST /faafacilities.json
[ { "docid": "3baf4aa4ec7722fa76791ba0ad7e8a90", "score": "0.6800668", "text": "def create\n @faafacility = Faafacility.new(params[:faafacility])\n\n respond_to do |format|\n if @faafacility.save\n format.html { redirect_to @faafacility, notice: 'Faafacility was successfully created.' }\n format.json { render json: @faafacility, status: :created, location: @faafacility }\n else\n format.html { render action: \"new\" }\n format.json { render json: @faafacility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "d907a53f73e255db227e72cd3a8bb5c9", "score": "0.60765636", "text": "def create\n @faculties = Faculty.create!(faculty_params)\n json_response(@faculties, :created)\n end", "title": "" }, { "docid": "b50e52ccacece5da0ac5dcd884e2b58e", "score": "0.60248834", "text": "def create\n @availablity = Availablity.new(params[:availablity])\n\n respond_to do |format|\n if @availablity.save\n format.html { redirect_to @availablity, notice: 'Availablity was successfully created.' }\n format.json { render json: @availablity, status: :created, location: @availablity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @availablity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d3b67893c7035dfabc3a33241a582eda", "score": "0.5903082", "text": "def new\n @faafacility = Faafacility.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @faafacility }\n end\n end", "title": "" }, { "docid": "9c828997b45db9cd342a213265c9ec4f", "score": "0.5875381", "text": "def create\n abilities = []\n client_application = current_user.client_application_id.to_s\n @abilities = Role.get_method_names.sort\n @role = Role.new(role_params)\n params[:role][:role_abilities].each do |ability|\n abilities << ability.to_sym\n end\n @role.role_abilities = [{\"action\"=> abilities, \"subject\"=>[:api]}]\n @role.client_application_id = client_application\n respond_to do |format|\n if @role.save\n format.html { redirect_to roles_path, notice: 'Role was successfully created.' }\n format.json { render :index, status: :created, location: @role }\n else\n format.html { render :new }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89f2cd900e5b06a37cc1fd1fffaed567", "score": "0.57818913", "text": "def create\n @award = Award.new(award_params)\n respond_to do |format|\n if @award.save\n a_data = JSON.parse params[:json_string]\n a_data.each do |a|\n @item = get_new_award_item(@award, a) unless a.nil?\n end\n AwardMailer.approval_request(@award)\n if current_user.admin\n format.html { redirect_to patient_path(@award.patient), notice: 'Award was successfully created.' }\n else\n format.html { redirect_to new_patient_path, notice: 'Award was successfully created.' }\n end\n format.json { render :show, status: :created, location: @award }\n else\n format.html { render :new }\n format.json { render json: @award.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a847bc07decadc3c1b79c1f9ec7de831", "score": "0.5772664", "text": "def create\n @instructor = Instructor.new(params[:instructor])\n\n respond_to do |format|\n if @instructor.save\n format.html { redirect_to @instructor, :notice => 'Instructor was successfully created.' }\n format.json { render :json => @instructor, :status => :created, :location => @instructor }\n else\n @aircraft_types = AircraftType.by_name.collect{|at| [at.name, at.id]}\n\n format.html { render :action => \"new\" }\n format.json { render :json => @instructor.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd42a45ffb9453b39e22e5da08887635", "score": "0.57606125", "text": "def create\n @facility = Facility.new(facility_params)\n @facility.save\n respond_with @facility\n end", "title": "" }, { "docid": "acfaf983cb4cf3f493158322f63229d3", "score": "0.5700159", "text": "def create\n @facility = Facility.new(params[:facility])\n\n respond_to do |format|\n if @facility.save\n format.html { redirect_to @facility, notice: 'Facility was successfully created.' }\n format.json { render json: @facility, status: :created, location: @facility }\n else\n format.html { render action: \"new\" }\n format.json { render json: @facility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd7f54048607b8bc88d6b6495b3dd27c", "score": "0.5688301", "text": "def create\n @facility = Facility.new(facility_params)\n\n respond_to do |format|\n if @facility.save\n format.html { redirect_to @facility, notice: \"Facility was successfully created.\" }\n format.json { render :show, status: :created, location: @facility }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @facility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "083f59ba7f39f46314ba4e41b005f9cb", "score": "0.5668729", "text": "def create\n @facility = Facility.new(facility_params)\n\n respond_to do |format|\n if @facility.save\n format.html { redirect_to @facility, notice: 'Facility was successfully created.' }\n format.json { render :show, status: :created, location: @facility }\n else\n format.html { render :new }\n format.json { render json: @facility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f63fa2f960c138711214dddfcfb6af1e", "score": "0.5659137", "text": "def create\n @oferta_academica = OfertaAcademica.new(params[:oferta_academica])\n\n if @oferta_academica.save\n render json: @oferta_academica, status: :created, location: @oferta_academica\n else\n render json: @oferta_academica.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ce385b40e36862d0d074a511efa0c6b5", "score": "0.56588274", "text": "def create\n @fullassessment = Fullassessment.new(fullassessment_params)\n respond_to do |format|\n if @fullassessment.save\n format.json { render json: @fullassessment }\n else\n format.html { render :new }\n format.json { render json: @fullassessment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8f28532018b15f4b9a4f90bf6723c0a3", "score": "0.56307656", "text": "def create\n @facility_item = FacilityItem.new(facility_item_params)\n\n respond_to do |format|\n if @facility_item.save\n format.html { redirect_to @facility_item, notice: 'Facility item was successfully created.' }\n format.json { render :show, status: :created, location: @facility_item }\n else\n format.html { render :new }\n format.json { render json: @facility_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce9f1da32d9fdb6ade0146d6fbed86c5", "score": "0.56280375", "text": "def create\n @facultade = Facultade.new(facultade_params)\n\n respond_to do |format|\n if @facultade.save\n format.html { redirect_to @facultade, notice: 'Facultade was successfully created.' }\n format.json { render :show, status: :created, location: @facultade }\n else\n format.html { render :new }\n format.json { render json: @facultade.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8396abdbfc3909e3d87e785259ee1bc", "score": "0.5608303", "text": "def facilities_params\n params.require(:facility).permit(:abbrev)\n end", "title": "" }, { "docid": "893287ff803714e9302b7192b5cdda3d", "score": "0.55652666", "text": "def create\n @facility = Facility.new(facility_params)\n\n respond_to do |format|\n if @facility.save\n format.html { redirect_to edit_facility_path(@facility), notice: 'Facility was successfully created.' }\n format.json { render :edit, status: :created, location: @facility }\n else\n format.html { render :new }\n format.json { render json: @facility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a19aa1746ca3ee1e66222e054c011fab", "score": "0.5563316", "text": "def abilities\n get('/ability/')\n end", "title": "" }, { "docid": "a7ae3ead7a4bab031f1ceb5706e3a863", "score": "0.5555461", "text": "def create\n raise BadRequestError.new('no current character') if current_character.nil?\n raise BadRequestError.new('tried to join an alliance although character is already in an alliance') unless current_character.alliance.nil?\n raise UnauthorizedError.new('no character given') if params[:auto_join_alliance_action][:character_id].nil?\n raise UnauthorizedError.new('tried to access another character') if params[:auto_join_alliance_action][:character_id].to_i != current_character.id\n raise ForbiddenError.new('joining new alliance not allowed') if !current_character.can_join_or_create_alliance?\n\n\n alliance = Fundamental::Alliance.select_auto_join_alliance(current_character)\n\n raise NotFoundError.new('no suitable alliance found') if alliance.nil?\n raise ConflictError.new(\"too many members in alliance\") if alliance.full?\n raise ForbiddenError.new('auto join is disabled for this alliance') if !alliance.auto_joinable\n \n alliance.add_character(current_character)\n \n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\n end", "title": "" }, { "docid": "0e2ce6137e3470a9bd6a35f82048dd33", "score": "0.55529094", "text": "def create\n\n # Rails.logger.warn \"====================\"\n # Rails.logger.warn foaf_params[:interests_attributes]\n # Rails.logger.warn \"====================\"\n\n \n @foaf = Foaf.new(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n end\n end\n\n respond_to do |format|\n if @foaf.save \n format.html { redirect_to @foaf, notice: 'FOAF was successfully created.' }\n format.json { render action: 'show', status: :created, location: @foaf }\n else\n format.html { render action: 'new' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a9dcfcf209aac83a1946570541986ee", "score": "0.5527556", "text": "def create\n @aplikace = Aplikace.new(aplikace_params)\n respond_to do |format|\n if @aplikace.save\n format.html { redirect_to @aplikace, notice: 'Aplikace was successfully created.' }\n format.json { render :show, status: :created, location: @aplikace }\n else\n format.html { render :new }\n format.json { render json: @aplikace.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "908489bd9498eda1acc72afadedd7b96", "score": "0.55255264", "text": "def create\n @aactio = Aactio.new(params[:aactio])\n\n respond_to do |format|\n if @aactio.save\n format.html { redirect_to @aactio, notice: 'Aactio was successfully created.' }\n format.json { render json: @aactio, status: :created, location: @aactio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @aactio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad8668965467633ff78d006cee60673a", "score": "0.55251014", "text": "def create\n @scheduled_facility = ScheduledFacility.new(params[:scheduled_facility])\n\n respond_to do |format|\n if @scheduled_facility.save\n format.html { redirect_to @scheduled_facility, notice: 'Scheduled facility was successfully created.' }\n format.json { render json: @scheduled_facility, status: :created, location: @scheduled_facility }\n else\n format.html { render action: \"new\" }\n format.json { render json: @scheduled_facility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39b02a2a2295981963abc29fbffbd33c", "score": "0.552271", "text": "def create\n @admitting = Admitting.new(admitting_params)\n\n if @admitting.save\n render json: @admitting, status: :created, location: @admitting\n else\n render json: @admitting.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "891b4ec38cc9c3275d103f028eaf37af", "score": "0.55208975", "text": "def destroy\n @faafacility = Faafacility.find(params[:id])\n @faafacility.destroy\n\n respond_to do |format|\n format.html { redirect_to faafacilities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3dbc5f7ff4be6d2fd8bd9c6a88376309", "score": "0.55199414", "text": "def create\n @facility_item = FacilityItem.new(facility_item_params)\n\n respond_to do |format|\n if @facility_item.save\n format.html { redirect_to '/facilities/'+@facility_item.facility_id.to_s+'/facility_items', notice: 'Facility item was successfully created.' }\n format.json { render :show, status: :created, location: @facility_item }\n else\n format.html { render :new }\n format.json { render json: @facility_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15862d3df4ae7933af895950c750bb0c", "score": "0.55186576", "text": "def create\n\n # Rails.logger.warn \"====================\"\n # Rails.logger.warn foaf_params[:interests_attributes]\n # Rails.logger.warn \"====================\"\n\n \n @foaf = Foaf.new(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n end\n end\n\n respond_to do |format|\n if @foaf.save \n format.html { redirect_to @foaf, notice: 'Foaf was successfully created.' }\n format.json { render action: 'show', status: :created, location: @foaf }\n else\n format.html { render action: 'new' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "53c61189bbbe9b3e2231f248cca823f9", "score": "0.5487244", "text": "def index\n @scheduled_facilities = ScheduledFacility.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @scheduled_facilities }\n end\n end", "title": "" }, { "docid": "a2af24a608e1463c32a42751da1ba135", "score": "0.5487214", "text": "def create\n\n raise BadRequestError.new('no current character') if current_character.nil?\n raise BadRequestError.new('missing parameter(s)') if params[:change_alliance_auto_join_action].nil? || params[:change_alliance_auto_join_action][:alliance_id].blank? \n\n raise ForbiddenError.new('tried to do a leader action although not even in an alliance') if current_character.alliance_id.blank?\n raise ForbiddenError.new('tried to change setting on wrong alliance') unless current_character.alliance_id == params[:change_alliance_auto_join_action][:alliance_id].to_i\n raise ForbiddenError.new('only leader can change auto join setting') unless current_character.alliance_leader?\n \n alliance = current_character.alliance\n alliance.auto_join_disabled = !((params[:change_alliance_auto_join_action][:auto_join_setting] || \"0\") == \"1\")\n \n raise BadRequestError.new('saving the auto join setting did fail.') unless alliance.save\n\n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\n end", "title": "" }, { "docid": "7ddcfdccbab4c3d1efb9f1fad7fcae8e", "score": "0.54663646", "text": "def index\n @facilities = Facility.all\n end", "title": "" }, { "docid": "5773e088a0ef9d80c2f4d35cbfcd41ef", "score": "0.54590285", "text": "def submit_form_2122\n validate_json_schema\n\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_using_identifier_and_source(header_md5: header_md5,\n source_name: source_name)\n unless power_of_attorney&.status&.in?(%w[submitted pending])\n power_of_attorney = ClaimsApi::PowerOfAttorney.create(\n status: ClaimsApi::PowerOfAttorney::PENDING,\n auth_headers: auth_headers,\n form_data: form_attributes,\n source_data: source_data,\n header_md5: header_md5\n )\n\n unless power_of_attorney.persisted?\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_by(md5: power_of_attorney.md5)\n end\n\n power_of_attorney.save!\n end\n\n ClaimsApi::PoaUpdater.perform_async(power_of_attorney.id)\n\n render json: power_of_attorney, serializer: ClaimsApi::PowerOfAttorneySerializer\n end", "title": "" }, { "docid": "b993acd7ff84d4c269e80b177e67aa5e", "score": "0.54587954", "text": "def create\n @academia = Academia.new(academia_params)\n\n respond_to do |format|\n if @academia.save\n format.html { redirect_to @academia, notice: 'Academia was successfully created.' }\n format.json { render :show, status: :created, location: @academia }\n else\n format.html { render :new }\n format.json { render json: @academia.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9799877a90aaa6ed084bb12908c936ce", "score": "0.5458274", "text": "def create\n @facility = Facility.new(facility_params)\n if @facility.save\n redirect_to facilities_path, notice: 'Facility was successfully created.'\n else\n render :new\n end\n end", "title": "" }, { "docid": "0e1bd4c929900ed2f7d778304c7c61ef", "score": "0.545422", "text": "def create\n @ais_attribute = AisAttribute.new(params[:ais_attribute])\n\n respond_to do |format|\n if @ais_attribute.save\n format.html { redirect_to @ais_attribute, notice: 'Record was successfully created.' }\n format.json { render json: @ais_attribute, status: :created, location: @ais_attribute }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ais_attribute.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b7446d0559787c0616a1d6c4d891d8a", "score": "0.54482514", "text": "def create\n @availibility_time_slot = AvailibilityTimeSlot.new(availibility_time_slot_params)\n\n respond_to do |format|\n if @availibility_time_slot.save\n format.html { redirect_to @availibility_time_slot, notice: 'Availibility time slot was successfully created.' }\n format.json { render :show, status: :created, location: @availibility_time_slot }\n else\n format.html { render :new }\n format.json { render json: @availibility_time_slot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f1b9e4f6762f3a12b263bb5c22d3b4ca", "score": "0.544597", "text": "def create\n @amenity = Amenity.new(params[:amenity])\n if @amenity.save\n render :json=>{:response=>\"success\"}\n else\n render :json=>failure1(@amenity.errors)\n end \n end", "title": "" }, { "docid": "8b373c43fef4b2092ec0d917756242a0", "score": "0.54367954", "text": "def create\n @facultad = Facultad.new(facultad_params)\n\n respond_to do |format|\n if @facultad.save\n format.html { redirect_to @facultad, notice: 'Facultad was successfully created.' }\n format.json { render :show, status: :created, location: @facultad }\n else\n format.html { render :new }\n format.json { render json: @facultad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f6132c0e049d7c3fb8efb63a3ea9518f", "score": "0.543499", "text": "def create\n @assoziation = Assoziation.new(assoziation_params)\n\n respond_to do |format|\n if @assoziation.save\n format.html { redirect_to moderator_faculty_assoziations_path(params[:faculty_id]), \n notice: 'Assoziation was successfully created.' \n }\n format.json { render :show, status: :created, location: @assoziation }\n else\n format.html { render :new }\n format.json { render json: @assoziation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "513891b778620cf28f7f4605b16fd64f", "score": "0.5433949", "text": "def index\n ota = Array.new\n if params[:facility].nil?\n # 自分の施設情報だけを返す\n facilities = current_user.facilities\n facilities.each do |facility|\n ota.concat(\n facility.ota.select do |otum|\n otum.provider != 'default'\n end\n )\n end\n else\n # facility=[facility_id]\n facility = Facility.find_by(id: params[:facility].to_i)\n # 施設IDが存在しない場合\n if facility.nil?\n response = {\n status: 'NotFound',\n message: 'ota not found'\n }\n return render json: response, status: 404\n end\n # ユーザーの施設IDでない場合\n if facility.user_id != current_user.id\n response = {\n status: 'NotFound',\n message: 'ota not found'\n }\n return render json: response, status: 404\n end\n\n ota.concat(\n facility.ota.select do |otum|\n otum.provider != 'default'\n end\n )\n end\n\n render json: {\n status: 'Success',\n message: '',\n ota: ota.as_json(except: [\n :password,\n :token,\n :created_at,\n :updated_at\n ], include: [\n :ota_rooms\n ])\n }, status: 200\n end", "title": "" }, { "docid": "049254b2cf10093d89bc6aefe5fa5284", "score": "0.5431706", "text": "def create\n @falta = Falta.new(falta_params)\n\n respond_to do |format|\n if @falta.save\n format.html { redirect_to @falta, notice: \"Falta was successfully created.\" }\n format.json { render :show, status: :created, location: @falta }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @falta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2111f9d6eccd620a1270c4d3fc19defe", "score": "0.542834", "text": "def create\n @haptic_fidelity = HapticFidelity.new(params[:haptic_fidelity])\n\n respond_to do |format|\n if @haptic_fidelity.save\n format.html { redirect_to @haptic_fidelity, notice: 'Haptic fidelity was successfully created.' }\n format.json { render json: @haptic_fidelity, status: :created, location: @haptic_fidelity }\n else\n format.html { render action: \"new\" }\n format.json { render json: @haptic_fidelity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2342f2b401f3a5faa2389240fe13369", "score": "0.5424025", "text": "def create\n @idea = current_member.ideas.new(idea_params) \n respond_to do |format|\n sectors_params.delete(\"\")\n if @idea.save\n sectors_params.each do |k|\n @idea.sectors << Sector.find_by(id:k)\n end\n format.json { head :no_content }\n format.js\n else\n\n format.json { render :json => { :error => @idea.errors.full_messages }, :status => 422 }\n end\n \n end\n end", "title": "" }, { "docid": "3d44307783f9e03e0a0d91a719a8ba0a", "score": "0.54221404", "text": "def create\n @ambience = Ambience.new(ambience_params)\n\n respond_to do |format|\n if @ambience.save\n format.html { redirect_to @ambience, notice: 'Ambience was successfully created.' }\n format.json { render :show, status: :created, location: @ambience }\n else\n format.html { render :new }\n format.json { render json: @ambience.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0bfe8abcaea2bc06fb2386cfcb716a62", "score": "0.54197705", "text": "def create\n raise ForbiddenError.new('Non-staff tried to create an alliance') unless staff?\n @fundamental_alliance = Fundamental::Alliance.new(params[:fundamental_alliance], :as => :creator)\n \n respond_to do |format|\n if @fundamental_alliance.save\n format.html { redirect_to @fundamental_alliance, notice: 'Alliance was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "2e2dfb6b41dcb284bf2022e36a2ed89b", "score": "0.54081345", "text": "def create\n @facultad = Facultad.new(facultad_params)\n\n respond_to do |format|\n if @facultad.save\n format.html { redirect_to facultade_path(@facultad), notice: \"Facultad fue creada correctamente.\" }\n format.json { render :show, status: :created, location: @facultad }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @facultad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2963730536e9df47abd2d2c1aa916af9", "score": "0.5402681", "text": "def create\n @feat_assignment = @character.feat_assignments.build (feat_assignment_params)\n\n respond_to do |format|\n if @feat_assignment.save\n format.html {\n if (@character.feat_assignments.size < 2)\n redirect_to new_character_feat_assignment_path(@character), notice: 'Feat assignment was successfully created.' \n else\n redirect_to @character, notice: 'All Feat assignments were successfully created.'\n end\n }\n format.json { render action: 'show', status: :created, location: @feat_assignment }\n else\n format.html { render action: 'new' }\n format.json { render json: @feat_assignment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e75ab3954bedfd1796ca54d1daabc8d0", "score": "0.54008925", "text": "def create\n @facility_type = FacilityType.new(facility_type_params)\n\n respond_to do |format|\n if @facility_type.save\n format.html { redirect_to @facility_type, notice: \"Facility type was successfully created.\" }\n format.json { render :show, status: :created, location: @facility_type }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @facility_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a610c5c4a57075ea1a8e6e895a1455a2", "score": "0.5390072", "text": "def create\n @amenity = Amenity.new(amenity_params)\n\n respond_to do |format|\n if @amenity.save\n format.html { redirect_to @amenity, notice: 'Amenity was successfully created.' }\n format.json { render :show, status: :created, location: @amenity }\n else\n format.html { render :new }\n format.json { render json: @amenity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e56818571eeda539b78848a3339df707", "score": "0.53853047", "text": "def create\n @safra = Safra.new(params[:safra])\n\n respond_to do |format|\n if @safra.save\n format.html { redirect_to @safra }\n else\n format.html { render action: \"new\" }\n format.json { render json: @safra.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1fecea0479cf595aad9c27620b38795b", "score": "0.53814155", "text": "def create\n idea_hash = params[:idea]\n idea_hash[:idea_actions] = idea_hash[:idea_actions].blank? ? [] : idea_hash[:idea_actions].map { | action_attrs | IdeaAction.new(action_attrs.merge(member: current_member)) }\n idea_hash[:talks] = idea_hash[:talks].blank? ? [] : idea_hash[:talks].map { | talk_attrs | Talk.find(talk_attrs[:id]) }\n\n @idea = Idea.new(idea_hash)\n @idea.member = member\n\n respond_to do |format|\n if @idea.save\n format.json { render json: @idea, status: :created, location: @idea }\n else\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f5b1af18d164ff530b4645ae0b6f192", "score": "0.5380616", "text": "def create\n if (params[:check])\n redirect_to new_asformulary_path#(rut_atendido: params[:asformulary][:rut_atendido])\n else\n @asformulary = Asformulary.new(asformulary_params)\n @asformulary.lyduser = current_lyduser\n @asformulary.user_id = 1\n\n\n respond_to do |format|\n if @asformulary.save\n\n\n format.html { redirect_to asformularies_path}#, notice: 'Asformulary was successfully created.' }\n format.json { render :show, status: :created, location: @asformulary }\n else\n format.html { render :new }\n format.json { render json: @asformulary.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "8c2be2bd670bbd988f0371a3d7406b54", "score": "0.53788465", "text": "def create\n @fact = @cat.facts.create!({ fact: api_request })\n if @fact.save\n render json: @fact\n else\n render error: { message: \"Não foi possível criar esse fato para este gatinho! :(\" }, status: 400\n end\n end", "title": "" }, { "docid": "3de803f6c83406c746b69e127859d7cc", "score": "0.53775686", "text": "def create\n @admeafit = Admeafit.new(admeafit_params)\n\n respond_to do |format|\n if @admeafit.save\n format.html { redirect_to @admeafit, notice: 'Admeafit was successfully created.' }\n format.json { render :show, status: :created, location: @admeafit }\n else\n format.html { render :new }\n format.json { render json: @admeafit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "69759e2a8f05eb897b95e2a67befaa70", "score": "0.536903", "text": "def index\n getProfile\n @availabilities = @therapist.get_availabilities\n @rec_Availabilities = @therapist.get_recuring_availabilities(2000,1)\n respond_to do |format|\n format.html { redirect_to availabitity_index, notice: \"Appointment declined.\"}\n format.json { render :status => 200, :json => { action: :index,\n availabilities: @availabilities,\n rec_availabilities: @rec_Availabilities,\n user: @user, therapist: @therapist}}\n end\n end", "title": "" }, { "docid": "69a752b7b1211b3308095774baf72e40", "score": "0.5357086", "text": "def create\n @accessory_act = AccessoryAct.new(params[:accessory_act])\n\n respond_to do |format|\n if @accessory_act.save\n format.html { redirect_to @accessory_act, :notice => 'Accessory act was successfully created.' }\n format.json { render :json => @accessory_act, :status => :created, :location => @accessory_act }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @accessory_act.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "802371a910f907af3843cb3240a4e59c", "score": "0.53566974", "text": "def create\n @avaliation = current_user.avaliations.build(avaliation_params)\n\n respond_to do |format|\n if @avaliation.save\n format.html { redirect_to @avaliation, notice: 'Avaliation was successfully created.' }\n format.json { render :show, status: :created, location: @avaliation }\n else\n format.html { render :new }\n format.json { render json: @avaliation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ed4a13f4b0585f9542ef2845cba5dff", "score": "0.5341119", "text": "def create\n @facult = Facult.new(facult_params)\n\n respond_to do |format|\n if @facult.save\n format.html { redirect_to @facult, notice: 'Facult was successfully created.' }\n format.json { render action: 'show', status: :created, location: @facult }\n else\n format.html { render action: 'new' }\n format.json { render json: @facult.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4afd3d2387804cc9410f03333baf1a90", "score": "0.5338838", "text": "def create\n @facility = Facility.new(facility_params)\n @facility.citizen = current_citizen\n\n respond_to do |format|\n if @facility.save\n format.html { redirect_to @facility, notice: 'Facility was successfully built.' }\n format.json { render :show, status: :created, location: @facility }\n else\n format.html { render :new }\n format.json { render json: @facility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17dd2d8903999e08ba4cd2ee447a62e7", "score": "0.53369874", "text": "def index\n @facilities = Facility.all\n respond_with @facilities\n end", "title": "" }, { "docid": "90fc2e9aba6a33f230ef06c62ea2145b", "score": "0.53172845", "text": "def update\n @faafacility = Faafacility.find(params[:id])\n\n respond_to do |format|\n if @faafacility.update_attributes(params[:faafacility])\n format.html { redirect_to @faafacility, notice: 'Faafacility was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @faafacility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1449560f795c1703b6e6a91bf6da04ff", "score": "0.53097975", "text": "def create\n announcer = current_user.announcer\n @vacancy = Vacancy.new(vacancy_params)\n\n respond_to do |format|\n if @vacancy.save\n format.html { redirect_to edit_announcer_path(announcer), notice: 'Vaga cadastrada com sucesso.' }\n format.json { render :show, status: :created, location: @vacancy }\n else\n format.html { render :new }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n authorize! current_user, @vacancy\n end", "title": "" }, { "docid": "e9d9ebb68763a5bf1887bad902eeed67", "score": "0.5308322", "text": "def create\n @decision = Decision.find(params[:fact][:decision_id])\n @fact = Fact.new(fact_params)\n @fact.neg = false\n @fact.save\n\n # Create allocations for new fact\n @decision.options.each do |o|\n allocation = Allocation.new\n allocation.option_id = o.id\n allocation.direction = true\n allocation.question = true\n allocation.relevant = true\n allocation.fact_id = @fact.id\n if (params[:option_id].to_i == o.id)\n allocation.question = false\n allocation.value = params[:value]\n end\n allocation.save\n end\n\n #Bewertung für alle User\n @decision.participants.each do |p|\n @rating = FactRating.new\n @rating.fact_id = @fact.id\n @rating.value = -10\n @rating.user_id = p.user.id\n @rating.save\n end\n\n redirect_to :back\n\n end", "title": "" }, { "docid": "0a35fbb0ea607a79fb7760c16055a23a", "score": "0.52944624", "text": "def create\n @assignment = Assignment.new(assignment_params)\n @assignment.save!\n timeslot = @assignment.timeslot\n timeslot.availability!\n\n render :json => true\n end", "title": "" }, { "docid": "2bb0af06e4a56eb066a97645cb78123f", "score": "0.5290056", "text": "def create\r\n @attestation = Attestation.new(params[:attestation])\r\n\r\n respond_to do |format|\r\n if @attestation.save\r\n format.html { redirect_to @attestation, notice: 'Attestation was successfully created.' }\r\n format.json { render json: @attestation, status: :created, location: @attestation }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @attestation.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "ac0f11e61145db6f462443b2845bafe7", "score": "0.52867013", "text": "def create\n @assurance = Assurance.new(assurance_params)\n\n respond_to do |format|\n if @assurance.save\n format.html { redirect_to @assurance, notice: 'Assurance was successfully created.' }\n format.json { render :show, status: :created, location: @assurance }\n else\n format.html { render :new }\n format.json { render json: @assurance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98204c4bcc4b800eeec78b151b1dbd37", "score": "0.5286163", "text": "def create\n @attestation = Attestation.new(attestation_params)\n\n respond_to do |format|\n if @attestation.save\n format.html { redirect_to @attestation, notice: 'Attestation was successfully created.' }\n format.json { render :show, status: :created, location: @attestation }\n else\n format.html { render :new }\n format.json { render json: @attestation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e1dfa5a99c9dfa354af73874363ec19", "score": "0.528348", "text": "def create\n @absence = Absence.new(absence_params)\n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to absences_url, notice: 'Отсутствие успешно создано.' }\n format.json { render :edit, status: :created, location: @absence }\n end\n end\n end", "title": "" }, { "docid": "3f25102ad60b6efe988563a33ea43432", "score": "0.5281591", "text": "def create\n @account = Account.find(params[:account_id])\n @allowance = @account.allowances.build(params[:allowance])\n\n respond_to do |format|\n if @allowance.save\n format.html { redirect_to @allowance, notice: 'Allowance was successfully created.' }\n format.json { render json: @allowance, status: :created, location: @allowance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @allowance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c556f4b846401c8674123944572210b", "score": "0.5280458", "text": "def create\n @vacancy = Vacancy.new(vacancy_params)\n\n respond_to do |format|\n if @vacancy.save\n update_skills\n format.html { redirect_to @vacancy, notice: 'Vacancy was successfully created.' }\n format.json { render :show, status: :created, location: @vacancy }\n else\n format.html { render :new }\n format.json { render json: @vacancy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4df034aea4231f3b0f812152c0ae9b26", "score": "0.5276441", "text": "def create\n @attendence = Attendence.new(params[:attendence])\n\n respond_to do |format|\n if @attendence.save\n format.html { redirect_to @attendence, notice: 'Attendence was successfully created.' }\n format.json { render json: @attendence, status: :created, location: @attendence }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attendence.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9bb6c9ea51af2a0e533a73d43207a18c", "score": "0.5270989", "text": "def create\n @afp = Afp.new(afp_params)\n\n respond_to do |format|\n if @afp.save\n format.html { redirect_to @afp, notice: 'Afp was successfully created.' }\n format.json { render :show, status: :created, location: @afp }\n else\n format.html { render :new }\n format.json { render json: @afp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abcce8e90338c5d2ce9137e7cd683d4a", "score": "0.52687436", "text": "def create\n @insurance_facility = InsuranceFacility.new(insurance_facility_params)\n\n respond_to do |format|\n if @insurance_facility.save\n format.html { redirect_to @insurance_facility, notice: 'Insurance facility was successfully created.' }\n format.json { render :show, status: :created, location: @insurance_facility }\n else\n format.html { render :new }\n format.json { render json: @insurance_facility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9c9b0d47ae0c976ce8311be18eb6980", "score": "0.5257256", "text": "def create\n @accessory = Accessory.new(params[:accessory])\n\n if @accessory.save\n render json: @accessory, status: :created, location: @accessory\n else\n render json: @accessory.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b337819bdd26a39827992cd077c4cf96", "score": "0.5238366", "text": "def create\n @athletes_team = AthletesTeam.new(athletes_team_params)\n\n respond_to do |format|\n if @athletes_team.save\n format.html { redirect_to @athletes_team, notice: 'Athletes team was successfully created.' }\n format.json { render :show, status: :created, location: @athletes_team }\n else\n format.html { render :new }\n format.json { render json: @athletes_team.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aac1b685313fb3c3a2617d4434955970", "score": "0.5235521", "text": "def create\n @audience = Audience.new(params[:audience])\n\n respond_to do |format|\n if @audience.save\n format.html { redirect_to @audience, notice: 'Audience was successfully created.' }\n format.json { render json: @audience, status: :created, location: @audience }\n else\n format.html { render action: \"new\" }\n format.json { render json: @audience.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1621bb3894cc50bdad17d6c164a6b894", "score": "0.5235071", "text": "def create\n @appliance = Appliance.new(appliance_params)\n @appliance.owner = current_user\n authorize @appliance\n respond_to do |format|\n if @appliance.save\n format.html { redirect_to @appliance, notice: 'Appliance was successfully created.' }\n format.json { render :show, status: :created, location: @appliance }\n else\n format.html { render :new }\n format.json { render json: @appliance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e2e33a0511b04a64a4525e4780f61c6", "score": "0.52302706", "text": "def create\n @aadt = Aadt.new(params[:aadt])\n\n respond_to do |format|\n if @aadt.save\n format.html { redirect_to @aadt, notice: 'Aadt was successfully created.' }\n format.json { render json: @aadt, status: :created, location: @aadt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @aadt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a6177886fd564094b19ae7c5c647e74", "score": "0.52268606", "text": "def create\n @atencion = Atencion.new(atencion_params)\n\n respond_to do |format|\n if @atencion.save\n format.html { redirect_to @atencion, notice: 'Atencion was successfully created.' }\n format.json { render :show, status: :created, location: @atencion }\n else\n format.html { render :new }\n format.json { render json: @atencion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1becba4ad8241f1cd43090ade1f2bc3", "score": "0.52257943", "text": "def create\n @taf = Taf.new(params[:taf])\n\n respond_to do |format|\n if @taf.save\n format.html { redirect_to @taf, notice: 'Taf was successfully created.' }\n format.json { render json: @taf, status: :created, location: @taf }\n else\n format.html { render action: \"new\" }\n format.json { render json: @taf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd3a22c42008f763c9924a6eeb02a5da", "score": "0.52237165", "text": "def create\n @oferta_academica = OfertaAcademica.new(oferta_academica_params)\n\n respond_to do |format|\n if @oferta_academica.save\n format.html { redirect_to @oferta_academica, notice: 'Oferta academica was successfully created.' }\n format.json { render :show, status: :created, location: api_v1_oferta_academica_url(@oferta_academica) }\n else\n format.html { render :new }\n format.json { render json: @oferta_academica.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87d790d471176abf817eb7e1835cfaf9", "score": "0.5219809", "text": "def create\n @asainactiverule = Asainactiverule.new(params[:asainactiverule])\n\n respond_to do |format|\n if @asainactiverule.save\n format.html { redirect_to @asainactiverule, notice: 'Asainactiverule was successfully created.' }\n format.json { render json: @asainactiverule, status: :created, location: @asainactiverule }\n else\n format.html { render action: \"new\" }\n format.json { render json: @asainactiverule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "01d7271522462e68545f6307f9fac758", "score": "0.52189946", "text": "def create\n @achievementuser = Achievementuser.new(params[:achievementuser])\n\n respond_to do |format|\n if @achievementuser.save\n format.html { redirect_to @achievementuser, notice: 'Achievementuser was successfully created.' }\n format.json { render json: @achievementuser, status: :created, location: @achievementuser }\n else\n format.html { render action: \"new\" }\n format.json { render json: @achievementuser.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13d7920cdb5c93781ae0805c6c415043", "score": "0.5214787", "text": "def ability_params\n params.require(:ability).permit(:number, :name, :description, :shortdescription)\n end", "title": "" }, { "docid": "1cc3f7ff6b13583bdf02bbeb71f8fa53", "score": "0.52110237", "text": "def create\n @absence = Absence.new(absence_params)\n\n respond_to do |format|\n if @absence.save\n format.html { redirect_to @absence, notice: 'Absence was successfully created.' }\n format.json { render :show, status: :created, location: @absence }\n else\n format.html { render :new }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80cb04658450d4d2326a432a0c38f177", "score": "0.5210208", "text": "def create\n @room_facility = RoomFacility.new(room_facility_params)\n\n respond_to do |format|\n if @room_facility.save\n format.html { redirect_to @room_facility, notice: 'Room facility was successfully created.' }\n format.json { render :show, status: :created, location: @room_facility }\n else\n format.html { render :new }\n format.json { render json: @room_facility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "685e9a723283c9d9fa8f827fd27ae9c1", "score": "0.5208882", "text": "def create\n @achievment = Achievment.new(params[:achievment])\n\n respond_to do |format|\n if @achievment.save\n format.html { redirect_to @achievment, notice: 'Achievment was successfully created.' }\n format.json { render json: @achievment, status: :created, location: @achievment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @achievment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9806a7017b589f806669fe126a17549e", "score": "0.52078867", "text": "def create_assignment(name)\n @url = \"http://#{$canvas_host}/api/v1/courses/#{$canvas_course_id}/assignments\"\n puts \"@url is #{@url}\"\n\n @payload={'assignment': { \n 'name': name,\n 'points_possible': '0',\n 'grading_type': 'pass_fail',\n 'published': 'true',\n 'submission_types': [ \"none\" ]\n }\n }\n\n @postResponse = HTTParty.post(@url, :body => @payload.to_json, :headers => $header )\n puts(\" POST to create assignment has Response.code #{@postResponse.code} and postResponse is #{@postRepsone}\")\nend", "title": "" }, { "docid": "e03b1261254195ff8f256843392618b2", "score": "0.52071476", "text": "def arealist_params\n params.require(:arealist).permit(:uuid, :name)\n end", "title": "" }, { "docid": "1c29d23f4dbb59473f97cded9a565046", "score": "0.52032936", "text": "def create\n @arealist = @user.Arealist.build(arealist_params)\n\n respond_to do |format|\n if @arealist.save\n format.html { redirect_to @arealist, notice: 'Arealist was successfully created.' }\n format.json { render :show, status: :created, location: @arealist }\n else\n format.html { render :new }\n format.json { render json: @arealist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e49eb8489e7044c50533f2783be53241", "score": "0.5201876", "text": "def create\n respond_to do |format|\n if @ai_contest.update_attributes(permitted_params)\n format.html { redirect_to @ai_contest, notice: 'Ai contest was successfully created.' }\n format.json { render json: @ai_contest, status: :created, location: @ai_contest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ai_contest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25d3c27ad843b9e69b22f81121777e30", "score": "0.5201487", "text": "def create\n @sectorial = Sectorial.new(sectorial_params)\n\n respond_to do |format|\n if @sectorial.save\n format.html { redirect_to @sectorial, notice: 'Sectorial was successfully created.' }\n format.json { render :show, status: :created, location: @sectorial }\n else\n format.html { render :new }\n format.json { render json: @sectorial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "50d33ed7b2a1e1acc4223f67a2bf025e", "score": "0.52006346", "text": "def create\n @appointmentrejection = Appointmentrejection.new(params[:appointmentrejection])\n @affiliate_id = params[:appointmentrejection][:affiliate_id]\n\n @isfacultyflag = Affiliate.find(params[:appointmentrejection][:affiliate_id]).isfaculty\n\n if @isfacultyflag\n @pidm = Affiliate.find(params[:appointmentrejection][:affiliate_id]).pidm\n end\n\n respond_to do |format|\n if @appointmentrejection.save\n \n if @isfacultyflag\n format.html { redirect_to affiliate_url(:id => params[:appointmentrejection][:affiliate_id], :pidm => @pidm) + \"#assignments\", notice: 'Appointment Rejection Added!' }\n else\n format.html { redirect_to affiliate_url(:id => params[:appointmentrejection][:affiliate_id])+ \"#assignments\", notice: 'Appointment Rejection Added!' }\n end\n\n # format.html { redirect_to affiliate_url(:id => params[:appointmentrejection][:affiliate_id]) + \"#assignments\", notice: 'Appointment Rejection Added!'}\n # format.json { render json: @appointmentrejection, status: :created, location: @appointmentrejection }\n else\n format.html { render action: \"new\" }\n #format.json { render json: @appointmentrejection.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77d7b57428d8d5ff00030703d9b1e94c", "score": "0.51993984", "text": "def create\n @anuphat = Anuphat.new(anuphat_params)\n\n respond_to do |format|\n if @anuphat.save\n format.html { redirect_to @anuphat, notice: 'Anuphat was successfully created.' }\n format.json { render :show, status: :created, location: @anuphat }\n else\n format.html { render :new }\n format.json { render json: @anuphat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d1fa030a60be24825065c8311d2d691d", "score": "0.5199179", "text": "def facilities\n [self]\n end", "title": "" }, { "docid": "d1fa030a60be24825065c8311d2d691d", "score": "0.5199179", "text": "def facilities\n [self]\n end", "title": "" }, { "docid": "68408a3b4c12c613ea53f1bd3a33cccf", "score": "0.5198435", "text": "def create\n @adopter = Adopter.new(adopter_params)\n\n if @adopter.save\n render json: @adopter, status: :created, location: @adopter\n else\n render json: @adopter.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "45b2c0cae7d52741f18940027ad28910", "score": "0.5196639", "text": "def create\n @achievement = Achievement.new(achievement_params)\n\n respond_to do |format|\n if @achievement.save\n format.html { redirect_to @achievement, notice: 'Achievement was successfully created.' }\n format.json { render :show, status: :created, location: @achievement }\n else\n format.html { render :new }\n format.json { render json: @achievement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3d28160c3649cea1f6c31355e02e876", "score": "0.51953584", "text": "def validator_captive_portal(args = {}) \n post(\"/profiles.json/captiveportal/\", args)\nend", "title": "" }, { "docid": "ccd187b7cf30713c255e6d7fc8c1fee0", "score": "0.5194267", "text": "def create\n @achievement = Achievement.new(achievement_params)\n\n respond_to do |format|\n if @achievement.save\n format.html { redirect_to @achievement, notice: 'Achievement was successfully created.' }\n format.json { render json: @achievement, status: :created, location: @achievement }\n else\n format.html { render \"new\" }\n format.json { render json: @achievement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9fe4d326aaf09f41b11a3ad4e53807ab", "score": "0.5192946", "text": "def create\n return false if !userCan :agendas\n @agenda = Agenda.new(params[:agenda])\n\n respond_to do |format|\n if @agenda.save\n format.html { redirect_to agendas_url }\n format.json { render json: @agenda, status: :created, location: @agenda }\n else\n format.html { render action: \"new\" }\n format.json { render json: @agenda.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56dbdf6340599a0e8e682027fa553f7d", "score": "0.51909876", "text": "def create\n @group = Group.find(params[:group_id])\n @asistence = Asistence.new(params[:asistence])\n\n respond_to do |format|\n if @asistence.save\n format.html { redirect_to @group, :notice => 'Asistence was successfully created.' }\n format.json { render :json => @asistence, :status => :created, :location => @asistence }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @asistence.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]