Wednesday, December 11, 2013

Redmine plugin creation in Ubuntu 13.10

export RAILS_ENV="production" 
ruby script/rails generate redmine_plugin testPlugin

Monday, December 9, 2013

Redmine: Retrieving all issues according to reverse chronological order

@issues  = Issue.order("created_on DESC").all

Redmine: Hiding the top menu before authentication

Change the following file from

file :: redmine/app/views/layouts/base.html.erb



<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
<%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>


to
<%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
 <%= render_menu :top_menu if User.current.logged? %>

Saturday, December 7, 2013

Redmine: Calendar object creation



 <% @year ||= Date.today.year %> 
     <% @month ||= Date.today.month %>
   
     
      
    <% end %>
   
   <%@calendarLocal = Redmine::Helpers::Calendar.new(Date.civil(@year, @month, 1), current_language, :week) %>

  <%=render :partial => 'common/calendar', :locals => {:calendar => @calendarLocal} %>

Redmine: Redirecting a link to project's calendar page





<%=  link_to project.name,project_path(project) << "/issues/calendar" %> 

Sunday, April 22, 2012

Solution : gem install minitest /usr/lib/ruby/gems/1.9.1/gems/turn-0.9.4/lib/turn/minitest.rb:23:in `': MiniTest v1.6.0 is out of date. (RuntimeError) `gem install minitest` and add `gem 'minitest' to you test helper.

My system info was like:
OS: Ubuntu 11.10
Ruby: version 1.9.2p290
Rails: version 3.1.1
Minitest gem: 2.12.1
I've had the following error when I tried to run the test command for my rails application.

rake test
The error message was like this: (Click on the image to read the text)



change the gemfile of the project and add the following lines:


group :test do
  gem "minitest"
end

Had a quite good test experience. 
Happy coding.

Friday, July 15, 2011

Setting up sensors in linux

Just install lm-sensors with this command:

sudo apt-get install lm-sensors


after installation use this command to get the status of the cpu:

sensors