Skip to content

Instantly share code, notes, and snippets.

#banner a {
text-decoration: none;
color: none;
}
#banner a:focus {
text-decoration: none;
color: none;
}
Started POST "/posts" for 127.0.0.1 at 2013-08-19 21:18:10 -0400
Processing by PostsController#create as JS
Parameters: {"utf8"=>"✓", "authenticity_token"=>"kTZyYTox6CM5xEGK1xAs4qLmA++WB4ZACedzI6inhPQ=", "post"=>{"title"=>"test", "comment"=>"test", "email"=>""}, "commit"=>"Submit"}
 (0.1ms) BEGIN
SQL (6.3ms) INSERT INTO "posts" ("comment", "created_at", "email", "title", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["comment", "test"], ["created_at", Tue, 20 Aug 2013 01:18:10 UTC +00:00], ["email", ""], ["title", "test"], ["updated_at", Tue, 20 Aug 2013 01:18:10 UTC +00:00]]
 (0.5ms) COMMIT
Rendered posts/create.js.erb (29.5ms)
Completed 500 Internal Server Error in 42ms
ActionView::Template::Error (Missing partial posts/post with {:locale=>[:en], :formats=>[:js, :html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched in:
@telagraphic
telagraphic / gist:5901394
Last active December 19, 2015 04:59
A user fills in a search form and the grid gets populated based on their input. Depending on their role, certain columns should be hidden. The issue is that $scope.gridOptions is initially loaded upon page load and the code below doesn't update the grid when I have removed column from the columnsDefs array in the gridOptions object. I haven't f…
$scope.getBrokerSales = function () {
var searchCriteria = {
....
};
BrokerSalesService.executeBrokerSalesSearch(searchCriteria).then(function (data) {
resetColumnDefs();
$scope.brokerSaleResults = data.BrokerSaleResults;
});
I'm trying to show/hide some columns in ng-grid based on which user is viewing the page.
The visible property doesn't take a function which returns a true or false boolean?
I thought it would, but it does not. So then how would I hide/show based on certain conditions?
$scope.gridOptions = {
data: 'myData',
canSelectRows: false,
displaySelectionCheckbox: false,
footerRowHeight: 35,
// data to paginate
$scope.getBrokerSales = function () {
$scope.resultMessage = 'Searching...';
var searchCriteria = {
fromDate: $scope.fromDate,
toDate: $scope.toDate,
};
BrokerSalesService.executeBrokerSalesSearch(searchCriteria).then(function (data) {
<tr>
<% if workout.persisted? %>
<td><%= time_ago_in_words(workout.created_at) %> ago</td>
<td><%= link_to workout.workouttype, edit_workout_path(workout) %></td>
<td><%= workout.reps %></td>
<td><%= workout.desc %></td>
<td><%= link_to 'remove', workout, confirm: 'Sure?', method: 'delete' %></td>
<% end %>
</tr>
@telagraphic
telagraphic / controller.js
Last active December 17, 2015 11:09
groups array doesn't populate when broker value is selected, need to use a different angular directive to catch the change?
function getBrokerList() {
var brokerList = ['All', 'A', 'B', 'C', 'D', 'E'];
return brokerList;
}
$scope.$watch('brokerValue', function (selectedBroker) {
$scope.groups = getBrokerGroupList(selectedBroker);
console.log($scope.groups);
});
class CategoriesController < ApplicationController
def new
@category = current_user.categories.build
@categories = current_user.categories
end
end
<% if @projects.any? %>
<ul>
<% @projects.each do |project| %>
<li>
<b><%= project.name %></b> |
<%= link_to "Done", project, confirm: "Sure?", method: "delete" %>
</li>
<% end %>
</ul>
<% end %>
ActiveRecord::RecordInvalid in PaymentsController#create
Validation failed: Amount is not a number
Rails.root: /Users/telagraphic/Documents/programming/rails_projects/life-ulator
Application Trace | Framework Trace | Full Trace
app/models/payment.rb:9:in `save_and_update'
app/controllers/payments_controller.rb:8:in `create'
Request