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 Admin < User | |
has_one :user, :as => :userable | |
attr_accessible :user | |
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
class UserPasswordResetsController < ApplicationController | |
#personal preferences here | |
def update | |
user = User.find_by(password_reset_token: params[:id]) | |
if !user.present? | |
head :not_found | |
elsif !(user.is_activated && user.is_active) | |
head :unprocessable_entity | |
elsif user.update_password params[:password], params[:password_confirmation] | |
head :ok |
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 show | |
@video = Video.find(params[:id]) | |
@related = @video.find_related_tags.limit(4) | |
end | |
===== | |
<h4>Similar videos:</h4> | |
<ul class="large-block-grid-4 small-block-grid-2 medium-block-grid-3"> | |
<%= @related.size %> |
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
<ul> | |
<% @users.each do |user| %> | |
<li> | |
<%= link_to("1. Letter of Representation", letter_of_user_path(user) %> | |
</li> | |
<% end %> | |
</ul> |
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
--- !ruby/hash:ActionController::Parameters | |
id: e6249bf8-562a-48ed-8a0e-0b5c89a96409 | |
mini_story_attributes: !ruby/hash:ActiveSupport::HashWithIndifferentAccess | |
id: a43fa828-345a-43c1-9d54-86ea5e8e8212 | |
name: Empty MS | |
generic_function_views_attributes: | |
sequential_execution_views_attributes: | |
delayed_selection_views_attributes: | |
simple_merge_views_attributes: | |
exclusive_selection_views_attributes: |
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
<strong>Name:</strong> | |
<%= activity.name %><br/> | |
<br/> | |
<%= image_tag(activity.image_url, :size => '250x250') %> | |
<br/> | |
<strong>Location</strong> | |
<%= activity.location %><br/> | |
<strong>Duration:</strong><br/> | |
<%= activity.start_date %><br/> | |
<%= activity.end_date %><br/> |
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 GroupsTrainer < ActiveRecord::Base | |
attr_accessible :area, :name, :trainer_id | |
belongs_to :trainer | |
has_many :home_gardeners | |
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
class Row | |
attr_accessor :supervisor_name, :name, :emp_pending, :sup_pending, :approved | |
def to_s | |
"Test #{@supervisor_name}, #{@name}, #{@emp_pending}, #{@sup_pending}, #{@approved}, #{total}, #{status}" | |
end | |
def total | |
@emp_pending + @sup_pending + @approved | |
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
<%= form_for Group.new do |f| %> | |
<table summary = "groups from trainer"> | |
<tr> | |
<th><%= f.label(:name) %></th> | |
<td><%= f.text_field(:name) %></td> | |
</tr> | |
<tr> | |
<th><%= f.label(:area) %></th> | |
<td><%= f.text_field(:area) %></td> | |
</tr> |
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 JTask | |
# JTask.find() | |
# Retrieves records from the database file. | |
# -------------------------------------------------------------------------------- | |
# Eg: JTask.find("test.json", 1) || JTask.find("test.json", first: 10) | |
# #=> <JTask id=x, ...> | |
# -------------------------------------------------------------------------------- | |
# See wiki guide for more usage examples... | |
# https://github.com/adammcarthur/jtask/wiki/find |
OlderNewer