Topic: Rails Full Calendar

I was wondering if anyone has had any experience with rails3_fullcalendar (https://github.com/bokmann/rails3_fullcalendar) . I have downloaded this repo and it is exactly what i am looking for in terms of functionality. There are one of 2 things i would like to do with this

1) merge this with my current application so that users can enjoy this feature
2) or re create the steps used to make this ( I feel this way i would learn more about how it works)

The only problem is i cannot find a guide that is suitable for someone relatively new to rails? Does anyone know of a guide for this or can someone suggest something similar

All help appreciated

Re: Rails Full Calendar

That's a very nice jquery plugin,  unfortunately you are unlikely to find anything more than what is already on that page you linked to.

The page is clearly intimidating to a rails new be. 

I think what you have to do is to create a new rails application using this command:

rails new calendar -m https://github.com/lleger/Rails-3-jQuery/raw/master/jquery.rb

Assume you were in the directory /home/richlewis14 when you issued that command,  so now you'd have a new directory

/home/richlewis14/calendar

That directory contains a rails application that uses that plugin,  but before that new rails app will run,  you have to get the actual plugin,  by issuing this command

wget http://arshaw.com/fullcalendar/downloads/fullcalendar-1.5.zip

That will download the plugin into some directory on your computer, let's assume it downloaded into 

/home/richlewis14/downloads/fullcalendar=1.5.zip

And you unzip the file and the actual plugin code ends up in

/home/richlewis14/downloads/fullcalendar-1.5

the next set of instructions tell you how to move the plugin code into into /home/richlewis14/calendar

mv /home/richlewis14/downloads/fullcalendar-1.5/jquery/jquery-ui-1.8.9.custom.min.js /home/richlewis14/calendar/public/javascripts/
mv /home/richlewis14/downloads/fullcalendar-1.5/demos /home/richlewis14/calendar/public/
mv /home/richlewis14/downloads/fullcalendar-1.5/fullcalendar/*.css /home/richlewis14/calendar/public/stylesheets/

See if you can get that far,  and I'l help with the next set of instructions regarding jquert.REST plugin

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Rails Full Calendar

Hi Brad

Thanks for the in depth answer, and yes it is rather intimidating to look at. I will try the steps you have described and let you know how it goes.. Just to give a slight update I have ventured into the inknown and tried something which kind of works, but no where near as powerful as full calendar..

I found Event_calendar https://github.com/elevation/event_calendar and follwed the quick start guide found in the wiki. What i have now is a basic functioning calendar that I can update events to, however only the title is updated to the calendar view, not the start time and end time ( Which is kind of the point)...

So i am going to follow your guide but would you be able to shed any light on the above issue?

Thanks again

Re: Rails Full Calendar

Also to add to the previous, if I can get full calendar up and running as its own app, will we then be combining with my current application?

Re: Rails Full Calendar

Yes

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Rails Full Calendar

Hi Brad

I have done as stated, ready for next instructions ( by the way, thank you so much for helping with this)

Re: Rails Full Calendar

also you stated to move javascripts/jquery and stylesheets to the public folder. I am using rails 3.1 so do i need to move to the appropriate folders, ie make use of the asset pipeline. when moving stylesheets  I had a message stating public/stylesheets is not a folder so have moved to app/assets/stylesheets

Re: Rails Full Calendar

i put javascript and jquery in public for now

Re: Rails Full Calendar

If you are new,  I would save the assets pipeline for later,  it will work with them in public.

Now go to this link

https://github.com/lyconic/jquery.rest

navigate to where you see a link for jquery.rest.js,  download that and put it in public/javascripts

Then see if you can boot the demo app.

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Rails Full Calendar

ok done that, fired up localhost:3000 and i am taken to the default rails homepage ( also i tried moving *.css to public stylesheets like mv /home/richard14/Downloads/fullcalendar-1.5/fullcalendar/*.css /home/richard14/calendar/public/stylesheets/ and i got this error message mv: cannot stat `/home/richard14/Downloads/fullcalendar-1.5/fullcalendar/*.css': No such file or directory

Re: Rails Full Calendar

ok, so i have created a stylesheets folder in 'public' manually and put fullcalendar.css in there, fired up the server and taken to default rails homepage

Re: Rails Full Calendar

You have to remove public/index.html.erb

try:

mv /home/richard14/Downloads/fullcalendar-1.5/fullcalendar/public/stylesheets/*.css /home/richard14/calendar/public/stylesheets/
Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Rails Full Calendar

still the same error message when i try as suggested, have removed public/index.html.erb and now when firing up the server i get Routing Error No route matches [GET] "/"

Re: Rails Full Calendar

what does calendar/config/routes.rb contain?

Maybe the guy wrote the demo app used assets???


mv /home/richard14/Downloads/fullcalendar-1.5/fullcalendar/app/assets/stylesheets/*.css /home/richard14/calendar/app/assets/stylesheets/

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Rails Full Calendar

The routes file is like this

Calendar::Application.routes.draw do
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  # root :to => 'welcome#index'

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id))(.:format)'
end

I have placed the *.css in the assets/stylesheets now, there is fullcalendar.css and fullcalendar.print.css

Is this as expected so far Brad?

Re: Rails Full Calendar

The routes.rb file is basically empty,  EVERYTHING is commented out!

You can verify this by cd'ing to

/home/richard14/calendar

and running the command

rake routes

It will show you that there are NO routes defined!!!

Maybe now is the time to start moving stuff to your REAL application?

Are you running rails 3.X for the REAL app you are trying to incorporate fullcalender into?

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Rails Full Calendar

Yes, using rails 3.1 for my real app.

Re: Rails Full Calendar

Hi Brad

Just wondering if you are able to assist with the move