// jQuery
$(document).ready(function() {
// code
})
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sirene@cleopatra:~/Escritorio/rails-master$ cd guides | |
sirene@cleopatra:~/Escritorio/rails-master/guides$ ls | |
assets bug_report_templates CHANGELOG.md rails_guides rails_guides.rb Rakefile source w3c_validator.rb | |
sirene@cleopatra:~/Escritorio/rails-master/guides$ rake guides:generate:html | |
/usr/local/bin/ruby rails_guides.rb | |
/home/sirene/Escritorio/rails-master/actionpack/lib/action_controller/metal/strong_parameters.rb:528:in `<class:Parameters>': cannot load such file -- rack/test (LoadError) | |
from /home/sirene/Escritorio/rails-master/actionpack/lib/action_controller/metal/strong_parameters.rb:106:in `<module:ActionController>' | |
from /home/sirene/Escritorio/rails-master/actionpack/lib/action_controller/metal/strong_parameters.rb:10:in `<top (required)>' | |
from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require' | |
from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
undefined method `original_filename' for "4896_EN_ROW_W52_Phones_868x250_12_12_2014_4_35_30_784.jpg":String | |
def create | |
@audition = Audition.create(_audition_param_) | |
@retail = @audition.retails.build(rettailram) | |
@imagenes = @audition.imagens.build(imagen_attributes) | |
uploaded_io = params[:Imagen][:ico] | |
File.open(Rails.root.join('public', 'data', uploaded_io.original_filename), 'wb') do |file| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
utf8"=>"✓", "authenticity_token"=>"FLAnBUVKZjPmCvCeeTV0wXnWDS2XvXjVFwUeSfdX3L+qdzVewEK6s3rBBtr2LXoSfI8QTUGqr7Z3J0QbAaqQYw==", "audition"=>{"name"=>"sassssssssssssssssssssssssssssssssssssssssssssssssssssss", "description"=>"sdfdsfddddddddddddddddddddddddddddd"}, "Retail"=>{"price"=>"66", "unit"=>"6"}, "Imagen"=>{"uploads"=>#<ActionDispatch::Http::UploadedFile:0x007f5c9e31f798 @tempfile=#<Tempfile:/tmp/RackMultipart20150121-11876-zokizh.css>, @original_filename="iw_sprite.css", @content_type="text/css", @headers="Content-Disposition: form-data; name=\"Imagen[uploads]\"; filename=\"iw_sprite.css\"\r\nContent-Type: text/css\r\n">}, "commit"=>"sell it", "controller"=>"auditions", "action"=>"create"} | |
when i add that validation | |
validates_format_of :uploads, :with => /\A.(jpg) \Z/i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Audition < ActiveRecord::Base | |
attr_writer :current_step | |
attr_accessor :brand | |
before_create :audition_time | |
belongs_to :category | |
has_many :prices | |
has_many :specifications | |
accepts_nested_attributes_for :specifications, reject_if: :all_blank, allow_destroy: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subcategories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file should contain all the record creation needed to seed the database with its default values. | |
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). | |
# | |
# Examples: | |
# | |
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) | |
# Mayor.create(name: 'Emanuel', city: cities.first) | |
# | |
Category.delete_all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Category < ActiveRecord::Base | |
belongs_to :root, class_name: "Category", :foreign_key => "category_id" | |
has_many :subcategories, class_name: "Category", foreign_key: "category_id" | |
has_many :auditions | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place all the styles related to the logins controller here. | |
// They will automatically be included in application.css. | |
// You can use Sass (SCSS) here: http://sass-lang.com/ | |
.pgfmr { | |
.pgfrm_left { | |
padding: 20px; | |
width: 50%; | |
height: 500px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def force_login | |
if !current_user | |
flash[:error]="Only logged in users can sell products. | |
Please #{view_context.link_to("Log in", :controller=>'logins', :action=>'new')} | |
and #{view_context.link_to("Sign up", :controller=>'users', :action=>'new')}if you don't have an account" | |
redirect_to auditions_url | |
end | |
end |
OlderNewer