Skip to content

Instantly share code, notes, and snippets.

View uokesita's full-sized avatar

Osledy Bazo uokesita

View GitHub Profile
%h1= "Construyendo este siito"
- @posts.each do |post|
.postShow
.sequence= "#" + post.secuencia.to_s
.title= link_to post.titulo, post
.date= l post.created_at, :format => :date
.admin
= link_to 'Editar', edit_post_path(post)
= link_to 'Borrar', post, :confirm => 'Estas seguro?', :method => :delete
es:
time:
formats:
date: "%d/%m/%Y"
#errorExplanation {
...
}
#errorExplanation h2 {
...
}
#errorExplanation ul li {
...
-if target.errors.any?
#errorExplanation
%h2= "#{pluralize(target.errors.count, "error")} prohibited this #{target.class.name.underscore.humanize.downcase} from being saved:"
%ul
- target.errors.full_messages.each do |msg|
%li= msg
= simple_form_for(@post) do |f|
= render 'shared/error_messages', :target => @post
.inputs
= f.input :title
= f.input :sequence
= f.input :description, :input_html => {:rows =>5}
.actions
= f.button :submit
function create(){
$this->form_validation->set_rules('title', 'Title', 'trim|required');
$this->form_validation->set_rules('content', 'Content', 'trim|required');
if($this->form_validation->run() == TRUE) {
$data = array(
'title' => $this->input->post('title'),
'contents' => $this->input->post('content')
);
class Post < ActiveRecord::Base
...
has_many :seccione, :dependent => :destroy
accepts_nested_attributes_for :seccione, :reject_if => :all_blank
...
end
= simple_form_for @post do |f|
...
= f.simple_fields_for :seccione do |seccion_f|
.seccion
%h2 Seccion
= seccion_f.input :cabecera
= seccion_f.input :cuerpo, :input_html => {:rows =>5}
= seccion_f.input :posicion
= f.button :submit
%h1= "\##{@post.secuencia} #{@post.titulo}"
%p= sanitize @post.descripcion
- for seccion in @post.seccione
.seccion
%h2= seccion.cabecera
.body= sanitize seccion.cuerpo
%hr
@uokesita
uokesita / gist:999610
Created May 30, 2011 23:00 — forked from duonoid/gist:807008
after gem update 2011-02-01 (most likely: rubygems-update-1.4.2 -> 1.5.0)
$ ./script/server
=> Booting Mongrel
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:in `requirement': undefined local variable or method `version_requirements' for #<Rails::GemDependency:0xf6e64a78> (NameError)
from /usr/local/lib/site_ruby/1.8/rubygems.rb:254:in `activate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:1204:in `gem'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:73:in `add_load_paths'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `each'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths'