Skip to content

Instantly share code, notes, and snippets.

<%= f.input :date_today, :collection => [['2 dager siden', Date.today-2], ['I går', Date.yesterday], ['I dag', Date.today.day]], :as :radio_buttons %>
def index
@admin = Admin.all
end
def new
@admin = Admin.new
end
def destroy
@admin.destroy
class Project < ActiveRecord::Base
# Sjekker at kolonnen navn er fyllt ut.
validates :name, presence: true
validates :client_id, presence: true
belongs_to :admin
belongs_to :client
has_many :registerhours, dependent: :destroy
end
<script type="text/javascript">
$(document).ready(function () {
$("#project_postnumber").blur(function(){
$.ajax({url: '/project/postplace', type: 'POST'})
.done(function(response){
$("#project_postplace").val(response);
});
});
});
</script>
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :authenticate_admin!
default_scope { where(company_id = current_admin.company_id ) }
end
2013-06-06 10:25:33 [124601/timer] info: signal 11 caught - shutting down
2013-06-06 10:25:33 [124535/watcher] error: worker process exited with 3 - restarting
2013-06-06 10:25:33 [124603/main] always: New Relic local daemon version 1.2.0.257/C+IA started - pid=124603 background=true SSL=false host=gyda.norisp.no
2013-06-06 10:25:34 [124603/main] info: RPM redirect: collector-0.newrelic.com(204.93.223.134) port 0 (0 means default port)
2013-06-06 10:25:34 [124603/timer] error: segmentation violation - stack dump follows .../usr/sbin/nrsysmond[0x404abc]
/lib64/libpthread.so.0[0x3bb0a0f500]
/usr/sbin/nrsysmond[0x536fc4]
/usr/sbin/nrsysmond[0x5374fb]
/usr/sbin/nrsysmond[0x40fe71]
/usr/sbin/nrsysmond[0x410e06]
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3" client="site" method="upgrade">
<name>SM360 Footer</name>
<author>Thomas Stroemme</author>
<authorEmail>thomas@sensemedia.no</authorEmail>
<authorUrl>http://sm360.no</authorUrl>
<copyright>SenseMedia 2013</copyright>
<license>GNU/GPL v2</license>
<version>1.0.0</version>
<description>Footer for SenseMedia website</description>
2013-05-30 10:02:19 [381321/timer] info: signal 11 caught - shutting down
2013-05-30 10:02:19 [381223/watcher] error: worker process exited with 3 - restarting
2013-05-30 10:02:19 [381329/main] always: New Relic local daemon version 1.2.0.257/C+IA started - pid=381329 background=true SSL=false host=gyda.norisp.no
2013-05-30 10:02:19 [381329/main] info: RPM redirect: collector-0.newrelic.com(204.93.223.134) port 0 (0 means default port)
2013-05-30 10:02:19 [381329/timer] error: segmentation violation - stack dump follows .../usr/sbin/nrsysmond[0x404abc]
/lib64/libpthread.so.0[0x3bb0a0f500]
/usr/sbin/nrsysmond[0x536fc4]
/usr/sbin/nrsysmond[0x5374fb]
/usr/sbin/nrsysmond[0x40fe71]
/usr/sbin/nrsysmond[0x410e06]
Started POST "/projects" for 127.0.0.1 at 2013-05-25 15:24:16 +0200
Processing by ProjectController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"jaXD4d7Qg+seIiSlbqcm9bF6m7lJ+GsYkGkDVPgM40M=", "project"=>{"project_name"=>"Thomas", "project_pass"=>"928irte"}, "commit"=>"Lag"}
Rendered project/new.html.erb within layouts/application (2.6ms)
Rendered layouts/_messages.html.erb (0.1ms)
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Rendered layouts/_menu.html.erb (3.1ms)
Rendered layouts/_footer.html.erb (0.3ms)
Completed 200 OK in 99ms (Views: 97.4ms | ActiveRecord: 0.3ms)
@thomasstr
thomasstr / delete_project.html.erb
Created May 25, 2013 13:19
Doesnt get any response from create method
<%= simple_form_for(@del_project, url: :del_project ) do |f| %>
<%#= f.error_notification %>
<div class="form-inputs">
<%= f.input :delete_project, collection: Project.list_domains.split("\n"), prompt: "Velg utviklingssted" %>
<%#= f.input %>
<%= f.button :submit, "Slett", class: "btn btn-danger" %>
</div>
<% end %>