Search Results

Search found 29 results on 2 pages for 'dannymcc'.

Page 1/2 | 1 2  | Next Page >

  • Disk space suddenly 100% used?

    - by dannymcc
    I'm trying to identify why, suddenly, 100% of our disk space is in use. I have already rebooted but the issue persists. Here are the outputs of some commands that are showing some strange (for me) results: danny@hydrogen:~$ df -h Filesystem Size Used Avail Use% Mounted on /dev/cciss/c0d0p1 130G 122G 949M 100% / none 1.9G 196K 1.9G 1% /dev none 2.0G 0 2.0G 0% /dev/shm none 2.0G 40K 2.0G 1% /var/run none 2.0G 0 2.0G 0% /var/lock none 2.0G 0 2.0G 0% /lib/init/rw danny@hydrogen:/$ sudo du -chs / du: cannot access `/proc/1662/task/1662/fd/4': No such file or directory du: cannot access `/proc/1662/task/1662/fdinfo/4': No such file or directory du: cannot access `/proc/1662/fd/4': No such file or directory du: cannot access `/proc/1662/fdinfo/4': No such file or directory danny@hydrogen:/$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/cciss/c0d0p1 135342296 128144108 323104 100% / none 1991336 196 1991140 1% /dev none 1995788 0 1995788 0% /dev/shm none 1995788 40 1995748 1% /var/run none 1995788 0 1995788 0% /var/lock none 1995788 0 1995788 0% /lib/init/rw danny@hydrogen:/$ mount /dev/cciss/c0d0p1 on / type ext4 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) none on /sys type sysfs (rw,noexec,nosuid,nodev) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) none on /dev type devtmpfs (rw,mode=0755) none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) none on /dev/shm type tmpfs (rw,nosuid,nodev) none on /var/run type tmpfs (rw,nosuid,mode=0755) none on /var/lock type tmpfs (rw,noexec,nosuid,nodev) none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) danny@hydrogen:/$ sudo du -h --max-depth=1 634M ./premvet_sync 5.6M ./etc 4.0K ./opt 16K ./lost+found 7.4M ./bin 623M ./lib 196K ./dev 0 ./sys 4.0K ./srv 4.0K ./cdrom 8.0K ./media 52K ./tmp ... it hangs for ages here..... The server is running Ubuntu 10.04.4 LTS. System load: 2.85 Temperature: 8 C Usage of /: 94.7% of 129.07GB Processes: 132 Memory usage: 39% Users logged in: 0 Swap usage: 0% IP address for eth0: 192.168.1.124 => / is using 94.7% of 129.07GB I'm struggling to comprehend why this is happening! Any pointers would be appreciated.

    Read the article

  • Cloudmin KVM DNS hostnames not working

    - by dannymcc
    I have got a new server which has Cloudmin installed. It's working well and I can create and manage VM's as expected. The server came with a /29 subnet and I requested an additional /29 subnet to allow for more virtual machines. I didn't want to replace the existing /29 subnet with a /28 because that would have caused disruption with my existing VM's. To make life easier I decided to configure a domain name for the Cloudmin host server to allow for automatic hostname setup whenever I create a new virtual machine. I have a domain name (example.com) and I have created an NS record as follows: NS kvm.example.com 123.123.123.123 A kvm.example.com 123.123.123.123 In the above example the IP address is that of the host server, I also have two /29 subnets routed to the server. Now, I've added the two subnets to the Cloudmin administration panel as follows: I've tried to hide as little information as possible without giving all of the server details away! If I ping kvm.example.com I get a response from 123.123.123.123, if I ping the newly created virtual machine (example.kvm.example.com) it fails, and if I ping the IP address that's been assigned to the new virtual machine (from the second subnet) it fails. Am I missing anything vital? Does this look (from what little information I can show) like it's setup correctly? Any help/pointers would be appreciated. For reference the Cloudmin documentation I am using as a guide is http://www.virtualmin.com/documentation/cloudmin/gettingstarted

    Read the article

  • VPN IP Routing - slow connections

    - by dannymcc
    UPDATE: Router error logs show: LCP Time-out 0 I'm not sure how to correct this. The Lan-to-Lan profiles are set to -1 Idle Timeout (for the remote branch). I have a PPTP VPN running between two Draytek 2820 routers. They are setup that one dials out to the other one. Main Practice - 192.168.1.0/24 Branch - 192.168.3.0/24 I have then set (on the Branch) router the following route: 192.168.1.0/24 If I then request a server running on 192.168.1.1 from the Branch, it correctly routes through VPN tunnel. If I request the branch server at 192.168.3.1 it correctly routes to the local server without using the VPN tunnel. I have temporarily disabled the firewall on both routers, and made sure that QoS is disabled. The Main Practice internet connection is ~30mb down / ~10mb up, and the Branch connection is ~5mb down / ~2mb up. Anything over the VPN tunnel runs pretty slowly (VNC, Remote Desktop and Terminal Emulators). However, if I dial using the Windows VPN wizard, creating a connection from the laptop to the Main Practice - everything runs quickly. I'm looking for possible causes, and/or ways of further diagnosing the issue. Any help would be greatly appreciated! UPDATE: In summary, when I connect within the Branch and try and access a host that's within the Main Practice it works, but slowly. If I then dial the VPN on my Windows 7 laptop whilst still connected to the Branch network, it's fast. Main Practice Branch Practice Routing Table from Branch Router Key: C - connected, S - static, R - RIP, * - default, ~ - private * 0.0.0.0/ 0.0.0.0 via 126.256.126.103 WAN2 C~ 192.168.1.99/ 255.255.255.255 directly connected VPN-1 S~ 192.168.1.0/ 255.255.255.0 via 192.168.1.99 VPN-1 S~ 192.168.2.0/ 255.255.255.0 via 192.168.1.99 VPN-1 C~ 192.168.3.0/ 255.255.255.0 directly connected LAN2 C 126.256.126.103/ 255.255.255.224 directly connected WAN2 Routing Table from Main Practice Key: C - connected, S - static, R - RIP, * - default, ~ - private * 0.0.0.0/ 0.0.0.0 via 81.139.64.1, WAN2 S 81.137.176.1/ 255.255.255.255 via 81.137.176.1, WAN2 * 81.139.64.1/ 255.255.255.255 via 81.139.64.1, WAN2 C~ 192.168.1.204/ 255.255.255.255 is directly connected, VPN C~ 192.168.1.0/ 255.255.255.0 is directly connected, LAN S~ 192.168.2.0/ 255.255.255.0 via 192.168.1.204, VPN S~ 192.168.3.0/ 255.255.255.0 via 192.168.1.203, VPN Connection Details (from Branch Router) Connection Details (from Main Practice Router) IPERF.exe Output

    Read the article

  • Network cabling with multiple patch panels?

    - by dannymcc
    I am in the very early stages of planning a network cabling upgrade in our office, mainly to upgrade the old cables from Cat5 to either 5e or 6. I am also planning on upgrading all of our 10/100 switches to 10/100/1000 switches. I would like to have three small wall mounted cabinets spread around the building, each with a patch panel and switch. These would all lead back to our server room. The question is; should I have two patch panels in each wall cabinet, one with 24 or 48 ports that are connected to a matching patch panel in the server room. The second patch panel would then link to each device in that cabinets area. Then I wouldn't put a switch in the small cabinets. All switching would be done in the server room. Or, should I have one main cable from the server room to each of the cabinets - plugged straight into the switch and the patch panel is for devices in the cabinets area? I hope that makes sense!

    Read the article

  • Basic IP address structure

    - by dannymcc
    We currently have a few servers, around 30-40 workstations and 16 phones. Each device has a static IP address. As an example the standard settings for a new workstation is; IP: 192.168.1.XXX Subnet: 255.255.255.0 Gateway: 192.168.1.99 DNS: 192.168.1.50 As I am slowly exploring new server OS's and virtualisation etc. I am getting close to wanting a wider range of IP addresses. What I would like to do is seperate the devices by IP as follows: Servers 192.168.1.XXX Workstations 192.168.2.XXX Printers 192.168.3.XXX Phones 192.168.4.XXX VM's 192.168.5.XXX Is this a bad idea, or is this a common way of doing things? My biggest concern is the phones and subnet masks. The phones are managed by our provider although I have access to the server that runs them. Would I need to change the subnet mask to 255.255.0.0 on all devices? Or only those that change? For example, the phones don't need to connect to any other devices other than other phones and the phone server. So if I have the phones on 192.168.1.XXX with a subnet mask of 255.255.255.0 and then moved everything I had complete ownership/control of to 192.168.X.XXX with a new subnet mask of 255.255.0.0. Would that work?

    Read the article

  • Draytek Vigor 2820 static IP's

    - by dannymcc
    I have a Draytek Vigor 2820 router which is connected to our ADSL provider (British Telecom, BT). We currently have one static IP address which is accessible from anywhere outside of our network and points at a simple web server on port 80. We have just been given 5 more static IP addresses which I would like to point at five servers that have static IP's. As an example: Current static IP - 80.123.123.123 New Static IP's - 100.100.100.100-105 Server IP's - 192.168.1.129-133 I have confused myself completely between NAT addresses, static routes and WAN IP aliases. If anyone can give me a clear idea of what I need to do it would be greatly appreciated.

    Read the article

  • Clone remote CentOS server to local test server?

    - by dannymcc
    We have a dedicated server running ContOS 5.5. The server runs our Magento store and a basic php website with mysql. I have a spare rack server in my office (HP ProLiant DL360 G4) that has more than enough storage space to store a duplicate of our dedicated server. I would like to clone the dedicated server entirely and have a local duplicate. It wouldn't need to be kept in sync because I can do that with GIT. The reason I want to do this is simple; learn more about the dedicated server and CentOS. Is this possible? I have SSH access to the dedicated server and obviously complete access to the local server.

    Read the article

  • Using VLANs that are routed together?

    - by dannymcc
    I have a quick question that's bugging me the more I read about VLANs. So far I understand that they are useful for dividing the network into sub-sections, but if you route them together does that not remove any security benefit? As an example, if I created a VLAN on my home network which was simply one computer, one server and one router.if I wanted to divide the network between computers and servers I could put the computer on VLAN 10 and the server on VLAN 20. Then the computer would no longer be able to communicate with the server - unless I added a static route to the router that connected the two together, basically telling VLAN 10 that VLAN 20 exists and how to communicate with it. The VLANs would then be connected in a similar way to a 'flat' network that has no VLANs. Therefore, surely, all security benefits are lost. Am I missing something?

    Read the article

  • VMware Virtualisation - Convert 64bit Windows Server to 32bit VM?

    - by dannymcc
    I have just started playing around with Vmware sphere and have the hypervisor OS installed on a spare HP ProLiant DL360 G4. I have created a test virtual machine running Ubuntu which has worked well. As a test project I wanted to convert a powered on server running Windows Server 2008 64bit into a virtual machine. As soon as I ran the Vmware Go software to start the conversion it became apparent that I cannot run 64bit guest OS's on that particular server. So, is there a way of migrating 64bit to 32bit during the conversion?

    Read the article

  • Add power over Ethernet without new switches?

    - by dannymcc
    I need to power 16 IP phones over their Ethernet connections. I am in the process of changing our switches and only the phones need PoE, everything else is powered by mains cables. I have contacted the supplier of the phones and for 16 mains leads it will be close to £300. I know it's possible to get a PoE injector that goes between the mains and the phone but I would like to do this as tidily as possible and ideally in bulk. I imagine something that looks like a switch but doesn't actually 'switch' if that makes sense. Basically I want to inject power to 16 devices at once.

    Read the article

  • Using Round Robin DNS on simple VPN setup

    - by dannymcc
    We have two internet connections which are load balanced to share the load between the two. We set this up after one of the internet provider proved to be less than reliable but great speed and latency wise when it is working. We'd rather utilise both connections as much as possible rather than leave one idle until the other drops out. We have a number of remote workers who occasionally need to connect via VPN from their laptops or iPads, we also have a small number of permanent LAN to LAN tunnels running from smaller branches. Originally we only had one internet connection and used one of our static IP addresses for all VPN users. Now that we have two internet connections running all of the time I am trying to make sure that the VPN is available to our team regardless of which connection drops. So my solution is to create two A records for our domain name with a value of vpn. and the two static IP addresses from each peer. Is this a sensible way of achieving this? Should I expect higher latency due to packets being lost if one peer fails and some packets still get routed to it anyway? A brief mockup of the setup I have:

    Read the article

  • IP Phone over VPN - one way calls unless default route?

    - by dannymcc
    I have come across a strange problem with our VPN and BCM 50 (Nortel/Avaya) phone system. As you can tell by my other questions I have been doing some work on setting a VPN up from one location to another and it's all working well. With one exception. We have an IP phone that is connected at the remote location, straight to a router which has a VPN tunnel to our main practice. The phone works mostly, but every few calls it turns into a one way call. As in, the caller (from the remote phone) can't hear the receiver- but the receiver can hear the caller. This is fixed by setting the VPN tunnel to be the default route for all traffic. The problem with fixing it that way is that all traffic then goes through the tunnel which slows internet access etc. down considerably. The router is set to send the following over the VPN: 192.168.1.0/24 192.168.2.0/24 192.168.4.0/24 The IP of the remote location is: 192.168.3.0/24 The remote router (where the phone is) is a Draytek 2830n, and the local router (at the main practice) is a Draytek 2820. We are using an IPSec tunnel with AES encryption <- as a result of a previous answer pointing to the incompatibility in the hardware encryption. Any advice would be appreciated!

    Read the article

  • How to sum cells depending on the content of a neighbor cell

    - by dannymcc
    I have an Excel document with the following columns; Date | Reference | Amount 23/01/11 | 111111111 | £20.00 25/09/11 | 222222222 | £30.00 11/11/11 | 111111111 | £40.00 01/04/11 | 333333333 | £10.00 31/03/11 | 333333333 | £33.00 20/03/11 | 111111111 | £667.00 21/11/11 | 222222222 | £564.00 I am trying to find a way of summarising the content in the following way; Reference : 111111111 Total: £727 So far the only way I have been able to achieve this is to filter the list by each reference number (manually) and then add a simple SUM formula to the bottom of the list of amounts. Are there any tricks that anyone knows that may speed this up? What I am trying to achieve is a spreadsheet that highlights each reference number that collectively exceeds over £2,000.

    Read the article

  • Increasing a Linux partition once VM size increased in vSphere?

    - by dannymcc
    I have a Ubuntu 12.04 VM running on VMWares ESXi 5.1. The server (VM) itself has run out of space, the results of df -h are as follows: Filesystem Size Used Avail Use% Mounted on /dev/sda1 19G 17G 1.2G 94% / udev 490M 4.0K 490M 1% /dev tmpfs 200M 232K 199M 1% /run none 5.0M 0 5.0M 0% /run/lock none 498M 0 498M 0% /run/shm The original VM HDD size was just under 19GB which is I have now increased to 100GB within the vCenter GUI: Is there a simple way of doing this? The VM doesn't seem to acknowledge the increase at all.

    Read the article

  • NAT and ISP Subnet when load balancing on pfsense?

    - by dannymcc
    I have a pfsense box that I'm trying to plan the configuration for. I am going to be load balancing two ISP's, each with their own /29 static IP subnet. The question I have is in relation to the way those IP's are associated with workstations on the local network. Currently I have some workstations with local (192.168.1.0/29) IP addresses, and other more complicated workstation setups have their own public IP address. Some of the more complicated systems have a NAT 1:1 configuration where I forward a public IP address to a local IP address. Others however are directly on the ISP subnet and cannot be seen on our local network. Is this configuration possible with pfsense? If so, what terms should I be looking through the documentation for? Here is a simple/brief diagram of what I am trying to achieve.

    Read the article

  • Server 2008 Net Send or Msg?

    - by dannymcc
    Hi Everyone, I have a Windows 2008 server running as a domain controller. The details are as follows: Domain: corp Server Name: oxygen The workstations are all running Windows XP SP3 and have fixed IP addresses. I am trying to use the net send functionality to be able to send simple messages to either individual machines/users and also to all machines. This is so I can send a message to a user to alert them about something, or likewise alert everyone of something such as the server being rebooted. Is this possible using Server 2008? If so, what would the command be? Thanks, Danny

    Read the article

  • Virtual machine lost after power cut

    - by dannymcc
    We have just had a power issue and our ESX (ESXi 4.1.0) host lost power and then rebooted. All but one of the virtual servers have rebooted with no problem, however one of them refused to power up. I try to power it on and I get the following error: File <unspecified filename> was not found Reason: The system cannot find the file specified. Cannot open the disk '/vmfs/volumes/4e03076e-90834647-b846-001185c38f42/LAMP- Stack/turnkey-lamp-11.3-lucid-x86.vmdk' or one of the snapshot disks it depends on. VMware ESX cannot find the virtual disk "/vmfs/volumes/4e03076e-90834647-b846- 001185c38f42/LAMP-Stack/turnkey-lamp-11.3-lucid-x86.vmdk". Verify the path is valid and try again. I have logged into the ESX host to see if the file is there an have found only the following file that matches the filename: /vmfs/volumes/4e03076e-90834647-b846-001185c38f42/LAMP-Stack/turnkey-lamp-11.3-l ucid-x86-s001.vmdk I notice that the above file has '-s001' after the filename. Is this recoverable? Any help of advice is greatly appreciated! EDIT: Running ls -l on the directory that contains the file shows this: drwxr-xr-t 1 root root 1680 Feb 9 09:49 4e03076e-90834647-b846-001185c38f42 The databrowser file system looks like this: and in a different directory there is the file that matches the missing one:

    Read the article

  • REST API Help in Rails

    - by dannymcc
    Hi Everyone, I am trying to get some information posted using our accountancy package (FreeAgentCentral) using their API via a GEM. http://github.com/aaronrussell/freeagent_api/ I have the following code to get it working (supposedly): Kase Controller def create @kase = Kase.new(params[:kase]) @company = Company.find(params[:kase][:company_id]) @kase = @company.kases.create!(params[:kase]) respond_to do |format| if @kase.save UserMailer.deliver_makeakase("[email protected]", "Highrise", @kase) @kase.create_freeagent_project(current_user) #flash[:notice] = 'Case was successfully created.' flash[:notice] = fading_flash_message("Case was successfully created & sent to Highrise.", 5) format.html { redirect_to(@kase) } format.xml { render :xml => @kase, :status => :created, :location => @kase } else format.html { render :action => "new" } format.xml { render :xml => @kase.errors, :status => :unprocessable_entity } end end end To save you looking through, the important part is: @kase.create_freeagent_project(current_user) Kase Model # FreeAgent API Project Create # Required attribues # :contact_id # :name # :payment_term_in_days # :billing_basis # must be 1, 7, 7.5, or 8 # :budget_units # must be Hours, Days, or Monetary # :status # must be Active or Completed def create_freeagent_project(current_user) p = Freeagent::Project.create( :contact_id => 0, :name => "#{jobno} - #{highrisesubject}", :payment_terms_in_days => 5, :billing_basis => 1, :budget_units => 'Hours', :status => 'Active' ) user = Freeagent::User.find_by_email(current_user.email) Freeagent::Timeslip.create( :project_id => p.id, :user_id => user.id, :hours => 1, :new_task => 'Setup', :dated_on => Time.now ) end lib/freeagent_api.rb require 'rubygems' gem 'activeresource', '< 3.0.0.beta1' require 'active_resource' module Freeagent class << self def authenticate(options) Base.authenticate(options) end end class Error < StandardError; end class Base < ActiveResource::Base def self.authenticate(options) self.site = "https://#{options[:domain]}" self.user = options[:username] self.password = options[:password] end end # Company class Company def self.invoice_timeline InvoiceTimeline.find :all, :from => '/company/invoice_timeline.xml' end def self.tax_timeline TaxTimeline.find :all, :from => '/company/tax_timeline.xml' end end class InvoiceTimeline < Base self.prefix = '/company/' end class TaxTimeline < Base self.prefix = '/company/' end # Contacts class Contact < Base end # Projects class Project < Base def invoices Invoice.find :all, :from => "/projects/#{id}/invoices.xml" end def timeslips Timeslip.find :all, :from => "/projects/#{id}/timeslips.xml" end end # Tasks - Complete class Task < Base self.prefix = '/projects/:project_id/' end # Invoices - Complete class Invoice < Base def mark_as_draft connection.put("/invoices/#{id}/mark_as_draft.xml", encode, self.class.headers).tap do |response| load_attributes_from_response(response) end end def mark_as_sent connection.put("/invoices/#{id}/mark_as_sent.xml", encode, self.class.headers).tap do |response| load_attributes_from_response(response) end end def mark_as_cancelled connection.put("/invoices/#{id}/mark_as_cancelled.xml", encode, self.class.headers).tap do |response| load_attributes_from_response(response) end end end # Invoice items - Complete class InvoiceItem < Base self.prefix = '/invoices/:invoice_id/' end # Timeslips class Timeslip < Base def self.find(*arguments) scope = arguments.slice!(0) options = arguments.slice!(0) || {} if options[:params] && options[:params][:from] && options[:params][:to] options[:params][:view] = options[:params][:from]+'_'+options[:params][:to] options[:params].delete(:from) options[:params].delete(:to) end case scope when :all then find_every(options) when :first then find_every(options).first when :last then find_every(options).last when :one then find_one(options) else find_single(scope, options) end end end # Users class User < Base self.prefix = '/company/' def self.find_by_email(email) users = User.find :all users.each do |u| u.email == email ? (return u) : next end raise Error, "No user matches that email!" end end end config/initializers/freeagent.rb Freeagent.authenticate({ :domain => 'XXXXX.freeagentcentral.com', :username => '[email protected]', :password => 'XXXXXX' }) The above render the following error when trying to create a new Case and send the details to FreeAgent: ActiveResource::ResourceNotFound in KasesController#create Failed with 404 Not Found and ActiveResource::ResourceNotFound (Failed with 404 Not Found): app/models/kase.rb:56:in `create_freeagent_project' app/controllers/kases_controller.rb:96:in `create' app/controllers/kases_controller.rb:93:in `create' Rendered rescues/_trace (176.5ms) Rendered rescues/_request_and_response (1.1ms) Rendering rescues/layout (internal_server_error) If anyone can shed any light on this problem it would be greatly appreciated! Thanks, Danny

    Read the article

  • Basecamp API Rails

    - by dannymcc
    Hi Everyone, I was wondering if someone could do me massive favour.. I really don't understand how to make use of API's - so I was wondering if, using Basecamp as an example, someone could talk me though the basics. So far I have an application with a dashboard controller/view, I have put basecamp.rb into my /lib directory, added the following to my application_controller: def basecamp_connect Basecamp.establish_connection!('XXXXXX.basecamphq.com', 'USER', 'PASS', false) @basecamp = Basecamp.new end Obviously changing the required parts to my credentials. Next up I have added the following to my dashboard_controller: def index Basecamp::TodoList.find(:all) end Next I presume I have to somehow list the Todo's on the dashboard using some sort of loop. Am I doing the right thing, if so - how on earth do I display all the todo items and if not - what am I doing wrong/missing. It doesn't have to be todo's, anything from basecamp or any other popular API service would be a good start. It's just that I happen to have a basecamp account! Thanks, Danny

    Read the article

  • Add note model in Rails

    - by dannymcc
    Hi Everyone, I am following the 15 minute blog tutorial on Ruby on Rails .com: http://media.rubyonrails.org/video/rails_blog_2.mov and am stumbling into some issues. I am using the following alterations to the names in the tutorial: posts = kases comments = notes I have setup the models as follows: class Kase < ActiveRecord::Base validates_presence_of :jobno has_many :notes belongs_to :company # foreign key: company_id belongs_to :person # foreign key in join table belongs_to :surveyor, :class_name => "Company", :foreign_key => "appointedsurveyor_id" belongs_to :surveyorperson, :class_name => "Person", :foreign_key => "surveyorperson_id" def to_param jobno end and... class Note < ActiveRecord::Base belongs_to :kase end The Notes controller look like this: # POST /notes # POST /notes.xml def create @kase = Kase.find(params[:kase_id]) @note = @kase.notes.build(params[:note]) redirect_to @kase end and the database scheme for Kases looks like this: create_table "notes", :force => true do |t| t.integer "kase_id" t.text "body" t.datetime "created_at" t.datetime "updated_at" end and for kases... create_table "kases", :force => true do |t| t.string "jobno" t.date "dateinstructed" t.string "clientref" t.string "clientcompanyname" t.text "clientcompanyaddress" t.string "clientcompanyfax" t.string "casehandlername" t.string "casehandlertel" t.string "casehandleremail" t.text "casesubject" t.string "transport" t.string "goods" t.string "claimantname" t.string "claimantaddressline1" t.string "claimantaddressline2" t.string "claimantaddressline3" t.string "claimantaddresscity" t.string "claimantaddresspostcode" t.string "claimantcontact" t.string "claimanttel" t.string "claimantmob" t.string "claimantemail" t.string "claimanturl" t.string "lyingatlocationname" t.string "lyingatlocationaddressline1" t.string "lyingatlocationaddressline2" t.string "lyingatlocationaddressline3" t.string "lyingatlocationaddresscity" t.string "lyingatlocationaddresspostcode" t.string "lyingatlocationcontactname" t.string "lyingattel" t.string "lyingatmobile" t.string "lyingatlocationurl" t.text "comments" t.string "invoicenumber" t.string "netamount" t.string "vat" t.string "grossamount" t.date "dateclosed" t.date "datepaid" t.datetime "filecreated" t.string "avatar_file_name" t.string "avatar_content_type" t.integer "avatar_file_size" t.datetime "avatar_updated_at" t.datetime "created_at" t.datetime "updated_at" t.string "kase_status" t.string "invoice_date" t.integer "surveyorperson_id" t.integer "appointedsurveyor_id" t.integer "person_id" t.string "company_id" t.string "dischargeamount" t.string "dishchargeheader" t.text "highrisesubject" end Whenever I enter a note into the kase show view's note entry form: <h2>Notes</h2> <div id="sub-notes"> <%= render :partial => @kase.notes %> </div> <% form_for [@kase, Note.new] do |f| %> <p> <%= f.label :body, "New Note" %><br /> <%= f.text_area :body %> </p> <p><%= f.submit "Add Note" %></p> <% end %> partial: <% div_for note do %> <p> <strong>Created <%= time_ago_in_words(note.created_at) %> ago</strong><br /> <%= h(note.body) %> </p> <% end %> I get the following error: ActiveRecord::RecordNotFound in NotesController#create Couldn't find Kase with ID=Test Case I have tried removing the def to_param jobno end from the kase model, but the same error shows. Any ideas what I'm missing? Thanks, Danny

    Read the article

  • Associated models in Rails?

    - by dannymcc
    Hi Everyone, In my rails application I have two models called Kases and Notes. They work in the same way comments do with blog posts, I.e. each Kase entry can have multiple notes attached to it. I have got everything working, but for some reason I cannot get the destroy link to work for the Notes. I think I am overlooking something that is different with associated models to standard models. Notes Controller class NotesController < ApplicationController # POST /notes # POST /notes.xml def create @kase = Kase.find(params[:kase_id]) @note = @kase.notes.create!(params[:note]) respond_to do |format| format.html { redirect_to @kase } format.js end end end Kase Model class Kase < ActiveRecord::Base validates_presence_of :jobno has_many :notes Note Model class Note < ActiveRecord::Base belongs_to :kase end In the Kase show view I call a partial within /notes called _notes.html.erb: Kase Show View <div id="notes"> <h2>Notes</h2> <%= render :partial => @kase.notes %> <% form_for [@kase, Note.new] do |f| %> <p> <h3>Add a new note</h3> <%= f.text_field :body %><%= f.submit "Add Note" %> </p> <% end %> </div> /notes/_note.html.erb <% div_for note do %> <div id="sub-notes"> <p> <%= h(note.body) %><br /> <span style="font-size:smaller">Created <%= time_ago_in_words(note.created_at) %> ago on <%= note.created_at %></span> </p> <%= link_to "Remove Note", kase_path(@kase), :confirm => 'Are you sure?', :method => :delete, :class => 'important' %> </div> <% end %> As you can see, I have a Remove Note destroy link, but that destroys the entire Kase the note is associated with. How do I make the destroy link remove only the note? <%= link_to "Remove Note", kase_path(@kase), :confirm => 'Are you sure?', :method => :delete, :class => 'important' %> Any help would, as always, be greatly appreciated! Thanks, Danny

    Read the article

  • Rails and Prawn PDF - add current item ID to filename?

    - by dannymcc
    Hi Everyone, I have two PDFs that are made "on the fly" using Prawn PDF. The PDFs are called jobsheet.pdf and discharge.pdf - their URL's are: railsroot/kases/IDNO/jobsheet.pdf railsroot/kases/IDNO/discharge.pdf I am trying to work out how to automagically append the filename with the ID number: railsroot/kases/IDNO/jobsheet_IDNO.pdf railsroot/kases/IDNO/discharge_IDNO.pdf To create the PDFs the code is as follows: Kases Controller def jobsheet @kase = Kase.find(params[:id]) respond_to do |format| format.html {} # jobsheet.html.erb format.xml { render :xml => @kase } format.pdf { render :layout => false } prawnto :prawn => { :background => "#{RAILS_ROOT}/public/images/jobsheet.png", :left_margin => 0, :right_margin => 0, :top_margin => 0, :bottom_margin => 0, :page_size => 'A4' } end end # GET /kases/1 # GET /kases/1.xml def discharge @kase = Kase.find(params[:id]) respond_to do |format| format.html { } # discharge.html.erb format.xml { render :xml => @kase } format.pdf { render :layout => false } prawnto :prawn => { :background => "#{RAILS_ROOT}/public/images/discharge.png", :left_margin => 0, :right_margin => 0, :top_margin => 0, :bottom_margin => 0, :page_size => 'A4' } end end Routes map.resources :kases, :member => { :discharge => :get } map.resources :kases, :member => { :jobsheet => :get } To view the PDF's I use the following links: jobsheet_kase_path(@kase, :format => 'pdf') discharge_kase_path(@kase, :format => 'pdf') Is this even possible? Thanks, Danny

    Read the article

  • Find items with belongs_to associations in Rails?

    - by dannymcc
    Hi Everyone, I have a model called Kase each "Case" is assigned to a contact person via the following code: class Kase < ActiveRecord::Base validates_presence_of :jobno has_many :notes, :order => "created_at DESC" belongs_to :company # foreign key: company_id belongs_to :person # foreign key in join table belongs_to :surveyor, :class_name => "Company", :foreign_key => "appointedsurveyor_id" belongs_to :surveyorperson, :class_name => "Person", :foreign_key => "surveyorperson_id" I was wondering if it is possible to list on the contacts page all of the kases that that person is associated with. I assume I need to use the find command within the Person model? Maybe something like the following? def index @kases = Person.Kase.find(:person_id) or am I completely misunderstanding everything again? Thanks, Danny EDIT: If I use: @kases= @person.kases I can successfully do the following: <% if @person.kases.empty? %> No Cases Found <% end %> <% if @person.kases %> This person has a case assigned to them <% end %> but how do I output the "jobref" field from the kase table for each record found?

    Read the article

  • Rails helper, show word not date.

    - by dannymcc
    Hi Everyone, A follow on from this questions: http://stackoverflow.com/questions/3032598/rails-created-at-on-display-if-today Is it possible to output the word TODAY rather than the date when using the following helper? def created_today k k.created_at if k.created_at.to_date == Date.today end <%=h created_today(k) %> Thanks, Danny

    Read the article

  • Rails and GIT workflow advice.

    - by dannymcc
    Hi Everyone, I need some advice with my desired setup with git and rails. Basically for my first Rails application I used a base application template from GitHub, I then made a ton of changes and now have a full application which is fairly customised. I have now extracted all of the changes I made to the files within the base application template and have committed the changes to my fork of the github repo. Ideally, I would like to have the base application template as a branch in my application and rebase it with my master. Is this actually possible? The reason I want to do this: I want to keep the base application up to date and functional, so for my next project I can just clone the base application template from my github fork and get working. Likewise, if anyone fixes any bugs in the base application template, I could merge those fixes with any application I have the base application template as a branch? Is this possible? Is there a better/more common way to do this? Thanks in advanced! Thanks, Danny

    Read the article

1 2  | Next Page >