This file contains hidden or 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
| Mi admin.py | |
| -------------------------- | |
| from django.contrib import admin | |
| from sitioprueba.books.models import Publisher, Author, Book, Tienda | |
| import settings | |
| media = settings.MEDIA_URL | |
| class ArticleAdmin(admin.ModelAdmin): | |
| # TinyMCE | |
| js = ('../files/js/tiny_mce/tiny_mce.js','../files/js/editores/textareas.js',) |
This file contains hidden or 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
| 81c81 | |
| < if (this.logueado == true) | |
| --- | |
| > /*if (this.logueado == true) | |
| 83c83 | |
| < query = "update usuarios set password = '@password', " + | |
| --- | |
| > query = "update usuarios set password = '@password', " + | |
| 88c88 | |
| < { |
This file contains hidden or 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
| <p> | |
| <b>Name:</b> | |
| <%=h @post.name %> | |
| </p> | |
| <p> | |
| <b>Email:</b> | |
| <%=h @post.email %> | |
| </p> | |
This file contains hidden or 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
| <div> | |
| <%= error_messages_for 'offer' %> | |
| <fieldset> | |
| <legend>Haga su oferta</legend> | |
| <% form_for :offer, :url => {:action => :save_offer} do |form| %> | |
| <p> | |
| <%= label :offer, :name, "Name:" %> | |
| <%= form.text_field :name, :size => 40%> |
This file contains hidden or 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 save_offer | |
| if request.post? | |
| @offer = Offer.new(params[:offer]) | |
| @offer.post = Post.find_by_id(session[:post_id]) | |
| @offer.save | |
| redirect_to :controller => 'post', :action => 'show' , :id => params[:id] | |
| end | |
| end | |
| def add_offer #accion para agregar oferta |
This file contains hidden or 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
| <% for resultado in @resultado %> | |
| <b>Fecha </b><%= resultado.fecha %><br> | |
| <b>Examen </b><%= resultado.examen.nombre %><br> | |
| <%end%> |
This file contains hidden or 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
| map.connect ':controller/:action/:id' | |
| map.connect ':controller/:action/:id.:format' | |
| #map.root :controller => "admin" proba asi para mientras :P | |
| map.resources :admin, :collection => {:auto_complete_for_paciente_nombre => :get,:auto_complete_for_examen_nombre => :get } |
This file contains hidden or 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 AdminController < ApplicationController | |
| layout 'admin' | |
| def index | |
| end | |
| #----------------PACIENTES ----------------------- | |
| def crear_paciente | |
| if request.post? # aca es para que no haga lo mismo con el get sino solo con el POST |
This file contains hidden or 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
| ----------------MODELO--------------------- | |
| class Paciente < ActiveRecord::Base | |
| belongs_to :usuario | |
| has_many :resultados | |
| end | |
| ----------------CONTROLADOR -------------------- | |
| class PacienteController < ApplicationController |
NewerOlder