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
$ gem list --local | |
*** LOCAL GEMS *** | |
abstract (1.0.0) | |
actionmailer (3.0.10) | |
actionpack (3.0.10) | |
activemodel (3.0.10) | |
activerecord (3.0.10) | |
activeresource (3.0.10) |
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
#the actual migration generated.... | |
class CreateEvaluatorRelations < ActiveRecord::Migration | |
def self.up | |
end | |
def self.down | |
end | |
end |
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
en: | |
editing: "editing %{thingy}" | |
another: "User" | |
# the idea is that I can call a dict definition from within another one? | |
#maybe im better off doing something like this: | |
#in view | |
t 'editing', :thingy => t('another') |
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
/* the idea here is to create a link with an image AND some text,,,, but ONLY the text gets underlined*/ | |
/* with this setup and CSS it is not possible to take out the underline of the img element (since it is an in-line element)*/ | |
<a href=#><img src="path/to/file" /> some text</a> | |
/* Because 'a' styling is supposed to have text-decoration:underline; and that affects the image too.... | |
even with: |
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
# I want to go from the session information (which contains the current logged in user_id) to his/her assigned EvaluationUser, down to his'/hers EvaluationCategories, down to the objectives associated to those, and finally the evidences related to each one of them.... | |
#the idea is being able to obtain and array of ob_evidences that the user has created.... but the following does not seem to work even though I have the associations which should make everything run swiftly,,,, | |
def index | |
@ob_evidences = EvaluationUser.where("user_id = ?", session[:user_id]).first.evaluation_categories.objectives.ob_evidences | |
end |
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
<td>Project<br/ > | |
<%= f.select :project_id, Project.all.collect{|a| [a.name, a.id]}%></td> | |
# the idea would be to do something similar to what one can do with text_tag | |
<%= text_tag :comment, :size => 10 %> # which renders a text_input element,,, with 10 spaces for character input... | |
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
I recommend getting the 10.04 LTS version meanwhile, but if you feel "edgy" you can get the latest one (though I haven't tested how easy it is to install Ruby there) | |
OS: | |
http://www.ubuntu.com/download/ubuntu/download | |
RUBY and everything else using RVM: | |
http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/ | |
Firefox: 1st uninstall the default one (is not linked to the ones in the repositories -- easily done through Ubuntu Software Center) | |
then in the terminal => |
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
<%= select_tag("objective[indicator_id]", options_for_select([["seleccione indicador",0]] + @indicators.map {|u| [u.name,u.id]}, selected = var_indicator ) , html_options = {:onchange => "this.form.elements['objective[criteria]'].value = this.form.elements['tmp_objective[indicator_id]'].options[ this.form.elements['objective[indicator_id]'].selectedIndex ].text "}) %> | |
<%= text_area_tag "objective[criteria]", var_criteria.to_s , :rows => 5, :cols => 70 %></td> | |
<div style="display:none;VISIBILITY:none;" > | |
<%= collection_select("tmp_objective", "indicator_id" , @indicators, "id", "suggested_criteria", options ={:prompt=>""}) %> | |
</div> |
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 home | |
# get 'login', :to => 'devise/sessions#new' in my routes.rb | |
redirect_to 'login' unless current_user #if not logged in, kick him out of here! | |
end |
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 fibonacci(n) | |
a = [1,1] | |
(n-2).times{ a[a.index(a.min)] = a[0]+a[1]} | |
a.max | |
end |
OlderNewer